fairdm.contrib.contributors.utils#

Utilities for contributors: external-data transforms, helpers and tokens.

Submodules#

Package Contents#

Functions#

clean_ror

Extract a bare ROR id from an id or a ror.org URL.

contributor_from_orcid_data

Create or update a person from ORCID API data.

contributor_from_ror_data

Create or update an organisation from ROR API data.

Data#

API#

fetch_orcid_data_from_api#

None

fetch_ror_data_from_api#

None

get_or_create_from_orcid#

None

get_or_create_from_ror#

None

update_or_create_from_orcid#

None

update_or_create_from_ror#

None

clean_ror(ror_id_or_link: str) → str#

Extract a bare ROR id from an id or a ror.org URL.

Args: ror_id_or_link: A ROR id or URL.

Returns: The bare ROR id.

contributor_from_orcid_data(data: dict, person=None, save: bool = True)#

Create or update a person from ORCID API data.

Args: data: The ORCID API record. person: An existing person to update. save: Whether to save the result.

Returns: The person.

contributor_from_ror_data(data: dict, org=None, save: bool = True)#

Create or update an organisation from ROR API data.

Args: data: The ROR API record. org: An existing organisation to update. save: Whether to save the result.

Returns: The organisation.