oer_africa.plugin ================= .. py:module:: oer_africa.plugin Attributes ---------- .. autoapisummary:: oer_africa.plugin._LICENSE_MAP oer_africa.plugin._HTML_TAG_RE oer_africa.plugin.json_path Classes ------- .. autoapisummary:: oer_africa.plugin.OERAFricaPlugin Functions --------- .. autoapisummary:: oer_africa.plugin._strip_html oer_africa.plugin._parse_datetime oer_africa.plugin._normalise_license Module Contents --------------- .. py:data:: _LICENSE_MAP :type: types.MappingProxyType[str, str] .. py:data:: _HTML_TAG_RE .. py:function:: _strip_html(text: str) -> str .. py:function:: _parse_datetime(value: str) -> datetime.datetime | None .. py:function:: _normalise_license(raw: str) -> str .. py:class:: OERAFricaPlugin Bases: :py:obj:`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 .. py:attribute:: mimetypes :type: tuple[str, Ellipsis] :value: ('application/vnd.oer-africa.resource+json',) .. py:attribute:: newsgroups :type: dict[str, str] .. py:attribute:: site_name :type: str :value: 'OER Africa' .. py:attribute:: librarian_contact :type: str :value: 'info@oerafrica.org' .. py:attribute:: logo :type: str :value: 'https://www.oerafrica.org/sites/default/files/oerafrica-logo.png' .. py:method:: make_metadata_card(resource: server.plugins.oer_africa.oer_africa_models.OERAFricaResource) -> server.plugins.ome_plugin.EducationResource .. py:method:: 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. .. py:method:: 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. .. py:method:: 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/?_format=json or the canonical resource URL. .. py:data:: json_path