“The wonderful new OpenLibrary Read API and Evergreen integration”
Tagged: openlibrary Toggle Comment Threads | Keyboard Shortcuts
I’ve started adding OPDS/BookServer support to Open Library, starting with OL Edition records. OPDS is an Atom-based specification for distribution of ebook metadata. You can read more at http://opds-spec.org.
For each edition record in OL, you can add “.odps” to the end of the edition key to retrieve the OPDS version. For example the OPDS entry for this edition of Peter Rabbit can be retrieved from
OPDS provides a good way of programmatically extracting and harvesting OL edition data. Currently, the OPDS record contains more metadata than the JSON version of an edition record, which makes it easy to grab author and subject data without multiple requests.
For example, to get an author name for an OL edition using JSON, you would first have to get the edition’s JSON record, find the work key, then request the work’s JSON record, then find the author key, then request the author’s JSON record, and then you would be able find the author name. The OPDS entry for an edition will contain Work-level data, so you can avoid jumping through hoops.
Also, for edition records added before Works were introduced in OL, the JSON edition record sometimes shows author and subject data which is old and sometimes incorrect!
We are still discussing how to support external identifiers, indirect acquisition, and DAISY links with the ODPS community, so the format of the OPDS record might change slightly in the future.
The template for the OPDS XML is at the end of this very long url:
This is the first step in closing this bug that Matt filed two years ago.. Poor Matt!
Since Open Library is a wiki, you can create a new page in almost any namespace you want (assuming you are an admin). We created http://openlibrary.org/libraries by going to that URL and clicking “Create it”.
So how can we get /libraries to use the /libraries/index.html template?
Anand helped by adding some python code in openlibrary/plugins/openlibrary/libraries.py:
class libraries(delegate.page): def GET(self): return render_template("libraries/index")
If the path of the page isn’t at the top level of the namespace, you can specify a path:
class locations(delegate.page): path = "/libraries/locations.txt" def GET(self): libraries = inlibrary.get_libraries() return render_template("libraries/locations")