This Python script updates the target URLs of DOIs registered via DataCite.
It reads a CSV file containing DOIs and their corrected URLs, and sends updates to the DataCite API.
- Reads DOIs and new URLs from a CSV file
- Sends
PUTrequests to the DataCite REST API to update theurlfield - Includes:
- Logging to a file
- Progress bar via
tqdm - Dry run mode (to preview changes without sending updates)
The input file should contain the following headers:
doi;url
10.xxxx/abcde;https://correct.link/abcde
10.xxxx/fghij;https://correct.link/fghij
Note: Use ; as the separator (common in Excel exports).
Edit the following variables in the script:
USERNAME = "your_datacite_username"
PASSWORD = "your_datacite_password"
CSV_FILE = "dois_to_update.csv"
DRY_RUN = True # Set to False to make real changes- Install dependencies:
pip install pandas requests tqdm- Run the script:
python buddu.py- Check
doi_update_log.txtfor a full log of updates.
Start with DRY_RUN = True to preview what would be updated before making changes.
Contributions and improvements are welcome!
Feel free to open a pull request or fork the repo: github.com/svidmar
MIT License – see LICENSE file.