-
Notifications
You must be signed in to change notification settings - Fork 105
Author
Rahul Kumaresan edited this page Mar 18, 2019
·
2 revisions
Returns a list of matching authors from the OpenLibrary authors' autocomplete API.
Usage:
>>> from olclient.openlibrary import OpenLibrary
>>> ol = OpenLibrary()
>>> ol.Author.search('Dan Brown')or
>>> from olclient.openlibrary import OpenLibrary
>>> ol = OpenLibrary()
>>> ol.Author.search('Dan Brown', 5)Uses the Authors auto-complete API to find OpenLibrary Authors with similar names. If any name is an exact match then return the matching author's 'key' (i.e. olid). Otherwise, return None.
>>> from olclient.openlibrary import OpenLibrary
>>> ol = OpenLibrary
>>> author_olid = ol.Book.get_olid_by_name('Dan Brown')Retrieves an OpenLibrary Author Object by Author OLID.
>>> from olclient.openlibrary import OpenLibrary
>>> ol = OpenLibrary()
>>> ol.Author.get('OL39307A')Retrieve works by an Author through OLID in JSON format.
>>> from olclient.openlibrary import OpenLibrary
>>> ol = OpenLibrary()
>>> author = ol.Author.get('OL39307A')
>>> works_list = author.works()to obtain paginated response, use the following parameters:
limit - To set the number of works to return.
offset - To specify the index of the first work to be returned.
>>> from olclient.openlibrary import OpenLibrary
>>> ol = OpenLibrary()
>>> author = ol.Author.get('OL39307A')
# list 20 works at a time
>>> works_list = author.works(limit=20)
# list the 2nd set of 20 works
>>> works_list = author.works(limit=20, offset=20)