API Reference¶
idutils.detectors
¶
Functions for detecting the persistent identifier.
detect_identifier_schemes(val)
¶
Detect persistent identifier scheme for a given value.
Note
Some schemes like PMID are very generic.
Source code in idutils/detectors.py
idutils.validators
¶
Utility file containing ID validators.
is_isbn10 = isbnlib.is_isbn10
module-attribute
¶
Test if argument is an ISBN-10 number.
is_isbn13 = isbnlib.is_isbn13
module-attribute
¶
Test if argument is an ISBN-13 number.
is_ads(val)
¶
is_ark(val)
¶
Test if argument is an ARK.
Source code in idutils/validators.py
is_arrayexpress_array(val)
¶
is_arrayexpress_experiment(val)
¶
is_arxiv(val)
¶
Test if argument is an arXiv ID.
See http://arxiv.org/help/arxiv_identifier and http://arxiv.org/help/arxiv_identifier_for_services.
is_arxiv_post_2007(val)
¶
is_arxiv_pre_2007(val)
¶
is_ascl(val)
¶
is_bioproject(val)
¶
is_biosample(val)
¶
is_cstr(val)
¶
is_doi(val)
¶
is_ean(val)
¶
Test if argument is a International Article Number (EAN-13 or EAN-8).
See http://en.wikipedia.org/wiki/International_Article_Number_(EAN).
is_ean13(val)
¶
Test if argument is a International Article Number (EAN-13).
Source code in idutils/validators.py
is_ean8(val)
¶
Test if argument is a International Article Number (EAN-8).
Source code in idutils/validators.py
is_email(val)
¶
Test if argument looks like an email address.
Note this test is designed to distinguish an email from other identifier schemes only. It does not imply a valid address / domain etc.
Source code in idutils/validators.py
is_ensembl(val)
¶
is_genome(val)
¶
is_geo(val)
¶
is_gnd(val)
¶
is_hal(val)
¶
is_handle(val)
¶
Test if argument is a Handle.
Note, DOIs are also handles, and handle are very generic so they will also match e.g. any URL your parse.
is_isbn(val)
¶
is_isni(val)
¶
Test if argument is an International Standard Name Identifier.
Source code in idutils/validators.py
is_issn(val)
¶
Test if argument is an ISSN number.
Source code in idutils/validators.py
is_istc(val)
¶
Test if argument is a International Standard Text Code.
See http://www.istc-international.org/html/about_structure_syntax.aspx
Source code in idutils/validators.py
is_lsid(val)
¶
is_openalex(val)
¶
Test if argument is an OpenAlex identifier.
See (https://docs.openalex.org/how-to-use-the-api/get-single-entities)
is_orcid(val)
¶
Test if argument is an ORCID ID.
See http://support.orcid.org/knowledgebase/ articles/116780-structure-of-the-orcid-identifier
Source code in idutils/validators.py
is_pmcid(val)
¶
is_pmid(val)
¶
Test if argument is a PubMed ID.
Warning: PMID are just integers, with no structure, so this function will say any integer is a PubMed ID
is_purl(val)
¶
Test if argument is a PURL.
Source code in idutils/validators.py
is_raid(val)
¶
Test if argument is a RAiD (Research Activity Identifier).
Note, RAiDs are issued as DOIs via DataCite and reuse the DOI "10.xxxx/yyyy" namespace, so a value may also validate as DOI/Handle. RAiD and DOI are format-identical; there is no format-level disambiguator.
See https://www.raid.org/
Source code in idutils/validators.py
is_refseq(val)
¶
is_rfc3987_ipath_absolute(val)
¶
is_rfc3987_iri(val)
¶
is_ror(val)
¶
is_rrid(val)
¶
is_sha1(val)
¶
is_sra(val)
¶
is_swh(val)
¶
Test if argument is a Software Heritage identifier.
https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html#syntax
Source code in idutils/validators.py
is_uniprot(val)
¶
is_url(val)
¶
is_urn(val)
¶
is_viaf(val)
¶
Test if argument is a VIAF id.
idutils.normalizers
¶
ID normalizer helper functions.
normalize_ads(val)
¶
normalize_arxiv(val)
¶
Normalize an arXiv identifier.
Source code in idutils/normalizers.py
normalize_doi(val)
¶
normalize_gnd(val)
¶
normalize_hal(val)
¶
normalize_handle(val)
¶
normalize_isbn(val)
¶
Normalize an ISBN identifier.
Also converts ISBN10 to ISBN13.
normalize_issn(val)
¶
normalize_openalex(val)
¶
normalize_orcid(val)
¶
Normalize an ORCID identifier.
Source code in idutils/normalizers.py
normalize_pid(val, scheme)
¶
Normalize an identifier.
E.g. doi:10.1234/foo and http://dx.doi.org/10.1234/foo and 10.1234/foo will all be normalized to 10.1234/foo.
Source code in idutils/normalizers.py
normalize_pmid(val)
¶
normalize_qid(val)
¶
normalize_raid(val)
¶
normalize_ror(val)
¶
normalize_urn(val)
¶
normalize_viaf(val)
¶
Normalize a VIAF identifier.
Source code in idutils/normalizers.py
to_url(val, scheme, url_scheme='http')
¶
Convert a resolvable identifier into a URL for a landing page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
val
|
The identifier's value. |
required | |
scheme
|
The identifier's scheme. |
required | |
url_scheme
|
Scheme to use for URL generation, 'http' or 'https'. |
'http'
|
Returns:
| Type | Description |
|---|---|
|
URL for the identifier. |
New in version 0.3.0
url_scheme used for URL generation.