idutils
raw JSON → 1.6.0 verified Fri May 01 auth: no python
A small library for detecting, validating, normalizing, and converting persistent identifiers used in scholarly communication, such as DOI, ORCID, ISBN, arXiv, and more. Current version 1.6.0 supports Python >=3.7. Release cadence is irregular, with maintenance updates as needed.
pip install idutils Common errors
error ModuleNotFoundError: No module named 'idutils' ↓
cause Package not installed or virtual environment not activated.
fix
Run 'pip install idutils' in the correct environment.
error AttributeError: module 'idutils' has no attribute 'is_doi' ↓
cause Attempting to call is_doi as idutils.is_doi() without importing the function.
fix
Use 'from idutils import is_doi' then call 'is_doi(...)' directly.
error ValueError: invalid identifier type: 'unknown' ↓
cause Passing an unsupported or misspelled identifier type to a function that expects a specific type.
fix
Check the list of supported types in the documentation and ensure correct string (e.g., 'doi', 'orcid').
Warnings
gotcha Function names are not intuitive; some are prefixed with 'is_' (e.g., is_doi) and some with 'check_' (e.g., check_doi). Always check the documentation for the correct function name. ↓
fix Refer to official API docs to avoid using non-existent functions like 'validate_doi'.
gotcha Normalization functions may return different formats (e.g., 'doi:10....' vs 'https://doi.org/10...'). Always test output before use. ↓
fix Read function docstrings to understand the output format.
gotcha ISBN validation is not fully robust: it may accept invalid ISBNs due to checksum bypass in older versions. Upgrade to latest version (1.6.0) for improved validation. ↓
fix pip install --upgrade idutils
Imports
- is_id wrong
import idutils; idutils.is_id()correctfrom idutils import is_id - normalize_doi wrong
from idutils.doi import normalize_doicorrectfrom idutils import normalize_doi
Quickstart
from idutils import is_doi, normalize_doi
doi = '10.1234/example'
print(is_doi(doi)) # True
print(normalize_doi(doi)) # 'doi:10.1234/example'