pressbooks.plugin ================= .. py:module:: pressbooks.plugin Attributes ---------- .. autoapisummary:: pressbooks.plugin.plugin Classes ------- .. autoapisummary:: pressbooks.plugin.PressbooksPlugin Module Contents --------------- .. py:class:: PressbooksPlugin Bases: :py:obj:`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: https://pressbooks.directory/wp-json/pressbooks/v2/books .. py:attribute:: mimetypes :type: tuple[str, Ellipsis] :value: ('application/vnd.pressbooks.book+json',) .. py:attribute:: newsgroups :type: dict[str, str] .. py:attribute:: site_name :type: str :value: 'Pressbooks Directory' .. py:attribute:: librarian_contact :type: str :value: 'info@iskme.org' .. py:attribute:: logo :type: str :value: 'https://pressbooks.org/app/themes/pressbooks-org/images/pressbooks-logo.svg' .. py:method:: make_metadata_card(book: server.plugins.pressbooks.pressbooks_models.PressbooksBook) -> server.plugins.ome_plugin.EducationResource Translate a PressbooksBook record into an OME EducationResource. .. py:method:: make_metadata_card_from_dict(doc_dict: dict) -> server.plugins.ome_plugin.EducationResource Create an EducationResource from a dict of Pressbooks book data. .. py:method:: make_metadata_card_from_json(json_payload: str) -> server.plugins.ome_plugin.EducationResource Create an EducationResource from a raw JSON string. .. py:method:: 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. .. py:data:: plugin