Skip to content
Michael E. Karpeles edited this page Feb 26, 2019 · 2 revisions

Work

1. Getting Editions related to the Work

Returns a list of editions of related to a particular work

>>> from olclient import OpenLibrary
>>> ol = OpenLibrary()
>>> ol.Work(olid).editions

2. Creating a new work on Open Library

Returns a list of editions of related to a particular work

>>> from olclient.openlibrary import OpenLibrary
>>> import olclient.common as common

>>> book = common.Book(title=u"Warlight: A novel", authors=[common.Author(name=u"Michael Ondaatje")], publisher=u"Deckle Edge", publish_date=u"2018")
>>> book.add_id(u'isbn_10', u'0525521194')
>>> book.add_id(u'isbn_13', u'978-0525521198'))
>>> ol.Work.create(book)  

3. Fetching an existing work on Open Library

Fetches an OpenLibrary Work Object via the book's olid.

>>> from olclient.openlibrary import OpenLibrary
>>> ol = OpenLibrary()
>>> work = ol.Work.get(u'OL12938932W')
>>> editions = work.editions

Clone this wiki locally