hermes.commands.deposit.invenio_rdm

Classes

InvenioRDMClient

A Requests session.

InvenioRDMResolver

InvenioRDMDepositPlugin

Base class that implements the generic deposition workflow.

Module Contents

class hermes.commands.deposit.invenio_rdm.InvenioRDMClient(config, auth_token=None, platform_name=None)

Bases: hermes.commands.deposit.invenio.InvenioClient

A Requests session.

Provides cookie persistence, connection-pooling, and configuration.

Basic Usage:

>>> import requests
>>> s = requests.Session()
>>> s.get('https://httpbin.org/get')
<Response [200]>

Or as a context manager:

>>> with requests.Session() as s:
...     s.get('https://httpbin.org/get')
<Response [200]>
get_license(license_id: str)
get_licenses()
class hermes.commands.deposit.invenio_rdm.InvenioRDMResolver(client=None)

Bases: hermes.commands.deposit.invenio.InvenioResolver

resolve_license_id(license_url: str | None) dict | None

Deliberately try to resolve the license URL to a valid InvenioRDM license information record from the vocabulary.

First, this method tries to find the license URL in the list of known license vocabulary (which is fetched each time, ouch…).

If the URL is not found (what is pretty probable by now, as CFFConvert produces SPDX-URLs while InvenioRDM still relies on the overhauled opensource.org URLs), the SPDX information record is fetched and all valid cross references are sought for.

Returns:

The vocabulary record that is provided by InvenioRDM.

static _extract_license_id_from_response(data: dict) str
_search_license_info(_url: str, valid_licenses: dict) dict | None
class hermes.commands.deposit.invenio_rdm.InvenioRDMDepositPlugin

Bases: hermes.commands.deposit.invenio.InvenioDepositPlugin

Base class that implements the generic deposition workflow.

command

The command running this plugin.

Type:

HermesCommand

metadata

The loaded curated metadata.

Type:

SoftwareMetadata

TODO: describe workflow… needs refactoring to be less stateful!