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 creadetAUTOMATIC- dois will be assigned automatically after publishON_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oarepo_doi-2.0.3.tar.gz.
File metadata
- Download URL: oarepo_doi-2.0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bede80bd65a856e69e64356dbd1e2ec789aab2d457cada7ea1d2e00e579fed53
|
|
| MD5 |
40363d9b763bc5050bf3a66bd23406aa
|
|
| BLAKE2b-256 |
b98ff72d313947c8e6457e8d2c646a6a9fb79a68ee11988761eaf167d97500d0
|
File details
Details for the file oarepo_doi-2.0.3-py3-none-any.whl.
File metadata
- Download URL: oarepo_doi-2.0.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccff2e4b4d46355f54dce3f02196f11e73bcdf0ec6285884550f66e11725f911
|
|
| MD5 |
107e39300f7f4b613861a90db7ef3faf
|
|
| BLAKE2b-256 |
560ba56609eaf3fd1a26a44b6805dbd0d1c2c509fbee85a2fd0bc16ff9ce64e5
|