libretexts.plugin

Attributes

LICENSE_TO_SPDX

Classes

LibreTextsPlugin

Plugin for LibreTexts Commons open textbooks.

Functions

_parse_date(value) → datetime.datetime | None

Module Contents

libretexts.plugin.LICENSE_TO_SPDX: types.MappingProxyType[str, str]
libretexts.plugin._parse_date(value: str) → datetime.datetime | None
class libretexts.plugin.LibreTextsPlugin

Bases: server.plugins.ome_plugin.OMEPlugin

Plugin for LibreTexts Commons open textbooks.

Translates LibreTexts Commons catalog records into OME EducationResource cards using the public JSON API at:

mimetypes: tuple[str, ...] = ('application/vnd.libretexts.book+json',)
newsgroups: dict[str, str]
site_name: str = 'LibreTexts'
librarian_contact: str = 'info@libretexts.org'
make_metadata_card(book: server.plugins.libretexts.libretexts_models.LibreTextsBook) → server.plugins.ome_plugin.EducationResource

Translate a LibreTextsBook 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 LibreTexts 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

Direct URL lookup is not supported; use bulk_import.py.