Skip to main content

No project description provided

Project description

OARepo DOI

Configuration example

DATACITE_URL = 'https://api.test.datacite.org/dois'

DATACITE_MODE = "AUTOMATIC_DRAFT"

DATACITE_CREDENTIALS = {"generic": {"prefix": "10.23644" , "password": "yyyy", "username": "xxx"}}

DATACITE_CREDENTIALS_DEFAULT = {"prefix": "10.23644" , "password": "yyy", "username": "xxxx"}

DATACITE_SPECIFIED_ID = True

mode types:

  • AUTOMATIC_DRAFT - dois will be assigned automatically when draft is creadet
  • AUTOMATIC - dois will be assigned automatically after publish
  • ON_EVENT - dois are assigned after request

DATACITE_SPECIFIED_ID

  • Default value - False
  • If true, the doi suffix will be the same as record pid

Providers

The DOI request is made through providers. To implement a new provider, you need to create a custom class that inherits from the OarepoDataCitePIDProvider from the oarepo_doi.services.provider module. This custom provider class should include your own metadata mapping.

Example of custom provider implementation:

from oarepo_doi.services.provider import OarepoDataCitePIDProvider

class NRDocsDataCitePIDProvider(OarepoDataCitePIDProvider):

    def metadata_check(self, record):
        
        data = record["metadata"]
        if "title" not in data:
            record.append("Title is mandatory")
        
        return record

    def create_datacite_payload(self, data):
        titles = {"title": "xy"}

        
        payload = {
            "data": {
                "type": "dois",
                "attributes": {
                }
            }
        }
        payload["data"]["attributes"]["titles"] = titles
   
        return payload
    

Next, the provider must be added to the Invenio configuration (invenio.cfg). For DOI client communication, the DataCiteClient from invenio_rdm_records.services.pids.providers is used.

Example of the configuration:

RDM_PERSISTENT_IDENTIFIER_PROVIDERS = [
    # DataCite Concept DOI provider
    NRDocsDataCitePIDProvider(
        "datacite",
        client=DataCiteClient("datacite", config_prefix="DATACITE"),
        label=_("DOI"),
    ),
]
RDM_PERSISTENT_IDENTIFIERS = {
    "doi": {
        "providers": ["datacite"],
        "label": _("DOI"),
        "is_enabled": NRDocsDataCitePIDProvider.is_enabled,
    },
    }
RDM_PARENT_PERSISTENT_IDENTIFIER_PROVIDERS = [
    # DataCite Concept DOI provider
    NRDocsDataCitePIDProvider(
        "datacite",
        client=DataCiteClient("datacite", config_prefix="DATACITE"),
        label=_("DOI"),
    ),
]

RDM_PARENT_PERSISTENT_IDENTIFIERS = {
    "doi": {
        "providers": ["datacite"],
        "label": _("DOI"),
        "is_enabled": NRDocsDataCitePIDProvider.is_enabled,
    },
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oarepo_doi-2.0.2.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oarepo_doi-2.0.2-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file oarepo_doi-2.0.2.tar.gz.

File metadata

  • Download URL: oarepo_doi-2.0.2.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for oarepo_doi-2.0.2.tar.gz
Algorithm Hash digest
SHA256 0d45fda3eca29f1c815b9864d2c777f8d6aeedc22fa93401b79639d223e5423e
MD5 cbfd3517ae9c0bd26dd62f3836fcb081
BLAKE2b-256 32e181834a53c88284f67d168c22e64a46da3b378267a3f7ca1aa384359a8adc

See more details on using hashes here.

File details

Details for the file oarepo_doi-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: oarepo_doi-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for oarepo_doi-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b37a14f1123271c160bd335aa63fd50469355cedcc4b49e420fbc71bf1d93aea
MD5 3d475e9f45a90a973a450502c66a6b5a
BLAKE2b-256 f15b6860ac6e2666e3fa9387c551e2ead64985418ecd53a61984e7e24e0c29db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page