This Python script automatically searches for and appends Digital Object Identifiers (DOIs) to entries in a BibTeX file that lack them. It utilizes the CrossRef API to query DOIs based on article titles, enhancing the completeness of bibliographic references.
- Parses BibTeX files to identify entries without DOIs.
- Queries the CrossRef API using titles of entries to find corresponding DOIs.
- Appends found DOIs to the BibTeX entries.
- Saves the updated BibTeX file with DOIs included.
Before running this script, ensure you have the following installed:
- Python 3.x
requests
librarypybtex
library
-
Clone the Repository
git clone https://github.com/yourusername/bibtex-doi-finder.git cd bibtex-doi-finder
-
Install Required Python Libraries
Run the following command to install the necessary Python libraries:
pip install requests pybtex
-
Prepare Your BibTeX File
Ensure your BibTeX file is ready and located in an accessible directory.
-
Edit the Script
Open
doi_finder.py
in a text editor and replace'your_bibtex_file.bib'
with the path to your BibTeX file. -
Run the Script
Execute the script from the command line:
python doi_finder.py
The script will process each entry in your BibTeX file, search for missing DOIs, and print the results. If a DOI is found, it will be appended to the entry. The script saves an updated version of your BibTeX file named
updated_lib.bib
.
Contributions to improve the script or address issues are welcome. Please feel free to fork the repository, make changes, and submit pull requests.
This project is open-sourced under the MIT License.
- Thanks to CrossRef for providing the API used to query DOIs.