project_gutenberg.plugin¶
Attributes¶
Classes¶
Plugin for Project Gutenberg (https://www.gutenberg.org). |
Module Contents¶
- project_gutenberg.plugin.GUTENBERG_BASE_URL = 'https://www.gutenberg.org'¶
- class project_gutenberg.plugin.ProjectGutenbergPlugin¶
Bases:
server.plugins.ome_plugin.OMEPluginPlugin for Project Gutenberg (https://www.gutenberg.org).
Project Gutenberg is the oldest digital library, offering over 70,000 free e-books — mainly literary works for which copyright has expired in the United States and are therefore in the public domain. This plugin uses the Gutendex public REST/JSON API (https://gutendex.com/) to translate book metadata into OME EducationResource cards.
API docs: https://gutendex.com/
- mimetypes: tuple[str, Ellipsis] = ('application/vnd.gutenberg.book+json',)¶
- newsgroups: dict[str, str]¶
- site_name: str = 'Project Gutenberg'¶
- librarian_contact: str = 'info@iskme.org'¶
- logo: str = 'https://www.gutenberg.org/gutenberg/pg-logo-129x80.png'¶
- make_metadata_card(book: server.plugins.project_gutenberg.gutenberg_models.GutenbergBook) server.plugins.ome_plugin.EducationResource¶
Translate a GutenbergBook into an OME EducationResource.
- make_metadata_card_from_dict(doc_dict: dict) server.plugins.ome_plugin.EducationResource¶
Create an EducationResource from a raw Gutendex book dict.
- make_metadata_card_from_json(json_payload: str) server.plugins.ome_plugin.EducationResource¶
Create an EducationResource from a Gutendex book JSON string.
- make_metadata_card_from_url(url: str) server.plugins.ome_plugin.EducationResource¶
Create a metadata card from a book URL.
Direct URL lookup is not currently supported. Use bulk_import.py to fetch books from the Gutendex REST API.
- make_metadata_cards_from_search_json(json_payload: str) list[server.plugins.ome_plugin.EducationResource]¶
Create EducationResource cards from a Gutendex search JSON string.
- project_gutenberg.plugin.plugin¶