facile_rs.utils.metadata.cff¶
Module Contents¶
Classes¶
A class for creating CFF citation files from CodeMeta metadata |
Functions¶
Converts schema.org identifier to CFF identifier. Supports only DOI identifiers for now. Returns an empty dict if identifier is not a schema.org-compliant DOI identifier. |
|
Converts schema.org identifier field to CFF identifiers. Supports only DOI identifiers for now. |
Data¶
API¶
- logger = 'getLogger(...)'¶
- class CffMetadata(data)¶
A class for creating CFF citation files from CodeMeta metadata
Initialization
Initialization from a CodeMeta metadata dictionary.
- Parameters:
data (dict) – data attribute of a class:CodemetaMetadata instance
- doi_prefix = 'https://doi.org/'¶
- orcid_prefix = 'https://orcid.org/'¶
- ror_prefix = 'https://ror.org/'¶
- name_types = None¶
- to_yaml()¶
Convert metadata to CFF format.
- Returns:
Content of the CFF file
- Return type:
str
- schema_org_identifier_to_cff(identifier)¶
Converts schema.org identifier to CFF identifier. Supports only DOI identifiers for now. Returns an empty dict if identifier is not a schema.org-compliant DOI identifier.
- Parameters:
identifier (dict) – schema.org compliant DOI identifier
- Returns:
CFF-formatted DOI identifier or empty dict if identifier was not compliant.
- Return type:
dict
- schema_org_identifiers_to_cff(identifiers)¶
Converts schema.org identifier field to CFF identifiers. Supports only DOI identifiers for now.
- Parameters:
identifier (dict or list of dict) – schema.org compliant DOI identifier field
- Returns:
CFF-formatted DOI identifier list
- Return type:
list of dict