pressbooks.plugin

Attributes

plugin

Classes

PressbooksPlugin

Plugin for the Pressbooks Directory (https://pressbooks.directory).

Module Contents

class pressbooks.plugin.PressbooksPlugin

Bases: server.plugins.ome_plugin.OMEPlugin

Plugin for the Pressbooks Directory (https://pressbooks.directory).

Translates Pressbooks REST API book records into OME EducationResource cards using the public JSON API at:

mimetypes: tuple[str, Ellipsis] = ('application/vnd.pressbooks.book+json',)
newsgroups: dict[str, str]
site_name: str = 'Pressbooks Directory'
librarian_contact: str = 'info@iskme.org'
make_metadata_card(book: server.plugins.pressbooks.pressbooks_models.PressbooksBook) server.plugins.ome_plugin.EducationResource

Translate a PressbooksBook record into an OME EducationResource.

make_metadata_card_from_dict(doc_dict: dict) server.plugins.ome_plugin.EducationResource

Create an EducationResource from a dict of Pressbooks book data.

make_metadata_card_from_json(json_payload: str) server.plugins.ome_plugin.EducationResource

Create an EducationResource from a raw JSON string.

make_metadata_card_from_url(url: str) server.plugins.ome_plugin.EducationResource

Fetch a single Pressbooks book record from the REST API by URL.

The URL should be the canonical book URL (e.g. https://example.pressbooks.com). The plugin will query the Pressbooks Directory REST API to find a matching book record.

pressbooks.plugin.plugin