Skip to content
Related Articles

Related Articles

Improve Article

Searching Books with Python

  • Last Updated : 22 Oct, 2020

In this article, we are going to write python scripts for searching books using isbntools modules. isbntools module able to search for books by there name or ISBN( International Standard Book Number) and return all the information about the book.

Installation: Run the following pip command:

pip install isbntools

Importing the module:

Python3




from isbntools.app import *

1. Use isbn_from_words() function to get the ISBN for a book.



Syntax: isbn_from_words(str) 

Parameter: book name

Returns: ISBN of the book.

Python3




get_isbn = isbn_from_words("Half Girlfriend")
print(get_isbn)

Output:

9788129135728

2. Get the information of a book by its ISBN.

Syntax: registry.bibformatters[identifiers](meta(isbn))

Parameter: ISB Number of the book



Returns: the meta infromation of the book

Notes: Identifiers can be used to print different types of format (bibtex, csl, opf, msword, endnote, refworks, json).

Python3




print(registry.bibformatters['labels'](meta("9788129135728")))

Output:

3. If you want to print the object without identifiers then you will all object in a specific location.

Python3




print(registry.bibformatters)

Output:

4. Get information in JSON format:



Python3




print(registry.bibformatters['json'](meta("9788129135728")))

Output:

5. Get information in MS Word format:

Python3




print(registry.bibformatters['msword'](meta("9788129135728")))

Output:

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course




My Personal Notes arrow_drop_up
Recommended Articles
Page :