libretexts.bulk_import¶
Attributes¶
Functions¶
|
Validate raw API items, logging all malformed records together. |
|
Fetch books matching |
|
Translate raw LibreTexts book dicts to OME EducationResource cards. |
|
Fetch LibreTexts books and return serialised OME records. |
Module Contents¶
- libretexts.bulk_import.CATALOG_API_URL = 'https://commons.libretexts.org/api/v1/commons/catalog'¶
- libretexts.bulk_import.logger¶
- libretexts.bulk_import.plugin¶
- libretexts.bulk_import._parse_records(items: list) list[server.plugins.libretexts.libretexts_models.LibreTextsBook]¶
Validate raw API items, logging all malformed records together.
- async libretexts.bulk_import.fetch_books(search: str = 'Python', limit: int = 100) list[server.plugins.libretexts.libretexts_models.LibreTextsBook]¶
Fetch books matching
searchfrom the LibreTexts Commons catalog API.
- libretexts.bulk_import.bulk_translate(books: list[dict]) collections.abc.Iterator[server.plugins.ome_plugin.EducationResource]¶
Translate raw LibreTexts book dicts to OME EducationResource cards.
- libretexts.bulk_import.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.