oer_africa.plugin

Attributes

_LICENSE_MAP

_HTML_TAG_RE

json_path

Classes

OERAFricaPlugin

Plugin for OER Africa — a continental repository of open educational resources

Functions

_strip_html(→ str)

_parse_datetime(→ datetime.datetime | None)

_normalise_license(→ str)

Module Contents

oer_africa.plugin._LICENSE_MAP: types.MappingProxyType[str, str]
oer_africa.plugin._HTML_TAG_RE
oer_africa.plugin._strip_html(text: str) str
oer_africa.plugin._parse_datetime(value: str) datetime.datetime | None
oer_africa.plugin._normalise_license(raw: str) str
class oer_africa.plugin.OERAFricaPlugin

Bases: server.plugins.ome_plugin.OMEPlugin

Plugin for OER Africa — a continental repository of open educational resources hosted at https://www.oerafrica.org.

Metadata is sourced from the Drupal JSON:API endpoint:

https://www.oerafrica.org/jsonapi/node/resource

Resources can be searched at:

https://www.oerafrica.org/search/site

mimetypes: tuple[str, Ellipsis] = ('application/vnd.oer-africa.resource+json',)
newsgroups: dict[str, str]
site_name: str = 'OER Africa'
librarian_contact: str = 'info@oerafrica.org'
make_metadata_card(resource: server.plugins.oer_africa.oer_africa_models.OERAFricaResource) server.plugins.ome_plugin.EducationResource
make_metadata_card_from_dict(doc_dict: dict) server.plugins.ome_plugin.EducationResource

Create a metadata card from a dict representing one OER Africa resource.

make_metadata_card_from_json(json_payload: str) server.plugins.ome_plugin.EducationResource

Create a metadata card from a JSON string for one OER Africa resource.

make_metadata_card_from_url(url: str) server.plugins.ome_plugin.EducationResource

Fetch a single OER Africa resource page and return its metadata card.

The URL should be of the form:

https://www.oerafrica.org/node/<nid>?_format=json

or the canonical resource URL.

oer_africa.plugin.json_path