libretexts.bulk_import ====================== .. py:module:: libretexts.bulk_import Attributes ---------- .. autoapisummary:: libretexts.bulk_import.CATALOG_API_URL libretexts.bulk_import.logger libretexts.bulk_import.plugin Functions --------- .. autoapisummary:: libretexts.bulk_import._parse_records libretexts.bulk_import.fetch_books libretexts.bulk_import.bulk_translate libretexts.bulk_import.bulk_import Module Contents --------------- .. py:data:: CATALOG_API_URL :value: 'https://commons.libretexts.org/api/v1/commons/catalog' .. py:data:: logger .. py:data:: plugin .. py:function:: _parse_records(items: list) -> list[server.plugins.libretexts.libretexts_models.LibreTextsBook] Validate raw API items, logging all malformed records together. .. py:function:: fetch_books(search: str = 'Python', limit: int = 100) -> list[server.plugins.libretexts.libretexts_models.LibreTextsBook] :async: Fetch books matching ``search`` from the LibreTexts Commons catalog API. .. py:function:: bulk_translate(books: list[dict]) -> collections.abc.Iterator[server.plugins.ome_plugin.EducationResource] Translate raw LibreTexts book dicts to OME EducationResource cards. .. py:function:: bulk_import(search: str = 'Python', cache_path: pathlib.Path | None = None) -> list[dict] Fetch LibreTexts books and return serialised OME records. Results are cached locally so that repeated runs do not re-fetch the API.