This project offers Python scripts for interacting with the EZID API to create and verify Digital Object Identifiers (DOIs).
Setup
- Clone the Repository: If you haven’t already, clone the EZID API repository.
- Configure Credentials: Create a
.env
file in the project root with yourEZID_USERNAME
andEZID_PASSWORD
. This file is Git-ignored for security. - Install Dependencies: Use
uv
to set up a virtual environment and install dependencies fromrequirements.txt
(uv venv
thenuv pip install -r requirements.txt
).
Usage
- Create a Test DOI: Run
uv run python create_doi.py
. A successful creation will show a201 Created
response and the DOI identifier. - Check the Status of a Test DOI: Run
uv run python check_doi.py
to retrieve and display the DOI’s metadata.
Verification
You can verify the DOI in a web browser:
- View Metadata: Access
https://ezid.cdlib.org/id/doi:10.5072/FK2/TESTDOI123
to see the raw metadata. - Resolve DOI: The DOI
https://doi.org/10.5072/FK2/TESTDOI123
will redirect tohttps://www.google.com
as configured.