hermes.commands.deposit.invenio_rdm
Classes
A Requests session. |
|
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]>
- 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.
- class hermes.commands.deposit.invenio_rdm.IvenioRDMDepositPlugin(command: hermes.commands.deposit.base.HermesDepositCommand, ctx: hermes.model.context.CodeMetaContext, client=None, resolver=None)
Bases:
hermes.commands.deposit.invenio.InvenioDepositPlugin
Base class that implements the generic deposition workflow.
TODO: describe workflow… needs refactoring to be less stateful!