Convert DOIs to BibTeX format. Works with multiple citation styles (GOST, APA, Chicago, IEEE, and standard BibTeX). Handy when you need to quickly generate bibliographic references without manually typing everything.
Takes DOIs (Digital Object Identifiers) and fetches all the metadata from Crossref, then formats it as BibTeX entries. You can also get plain text citations ready to copy-paste. Supports different citation styles so you can match whatever format your journal or institution requires.
- Multiple ways to input DOIs: command line, text files, CSV, or pipe from other commands
- Different citation styles: standard BibTeX, GOST (Russian), APA, Chicago, and IEEE
- Fetches metadata automatically from Crossref
- Handles multiple DOIs at once with progress tracking
- Skips invalid DOIs and keeps going
- Can generate both BibTeX and plain text citations
You'll need Python 3.8 or higher. If you don't have pip, install it first.
- Navigate to the directory:
cd doibib- Install the required package:
pip install -r requirements.txtThat's it. The only dependency is habanero which talks to the Crossref API.
Convert a single DOI:
python doi_to_bibtex.py 10.1016/j.jaip.2022.05.023Multiple DOIs at once:
python doi_to_bibtex.py 10.1016/j.jaip.2022.05.023 10.1007/s00421-018-3910-3Different journals want different formats. Here's how to use each style:
GOST (for Russian publications):
python doi_to_bibtex.py --style gost 10.1016/j.jaip.2022.05.023APA:
python doi_to_bibtex.py --style apa 10.1016/j.jaip.2022.05.023Chicago:
python doi_to_bibtex.py --style chicago 10.1016/j.jaip.2022.05.023IEEE:
python doi_to_bibtex.py --style ieee 10.1016/j.jaip.2022.05.023If you have a bunch of DOIs in a text file (one per line):
python doi_to_bibtex.py --file dois.txtFrom a CSV file:
python doi_to_bibtex.py --csv papers.csv --doi-column DOIYou can also pipe DOIs in:
echo "10.1016/j.jaip.2022.05.023" | python doi_to_bibtex.py --stdinor:
cat dois.txt | python doi_to_bibtex.py --stdinSave to a file:
python doi_to_bibtex.py 10.1016/j.jaip.2022.05.023 --output references.bibSometimes you just need a citation to paste into a document or email. Use --text-output:
python doi_to_bibtex.py 10.1016/j.jaip.2022.05.023 --style apa --output refs.bib --text-output refs.txtThis creates both a BibTeX file and a text file with formatted citations you can copy-paste directly.
If you don't want to see progress messages:
python doi_to_bibtex.py --quiet 10.1016/j.jaip.2022.05.023positional arguments:
dois DOIs to convert (URLs or plain DOIs both work)
optional arguments:
-h, --help Show help
--file FILE, -f FILE Read DOIs from a text file (one per line)
--csv CSV Read DOIs from a CSV file
--stdin Read DOIs from standard input
--doi-column COLUMN Column name in CSV containing DOIs (default: DOI)
--style STYLE, -s STYLE
Citation style: standard, gost, apa, chicago, ieee
(default: standard)
--output OUTPUT, -o OUTPUT
Output BibTeX file (default: prints to stdout)
--text-output TEXT_OUTPUT, -t TEXT_OUTPUT
Also create a plain text file with formatted citations
--delay DELAY Seconds to wait between API requests (default: 0.5)
--quiet, -q Don't show progress messages
Default format. Works with most LaTeX setups.
Author format: Last, First and Last, First
For Russian academic publications. Follows ГОСТ 7.0.5-2008.
Author format: Фамилия, И. О. and Фамилия, И. О. (initials after last name)
American Psychological Association style.
Author format: Last, F. M. and Last, F. M. (initials)
Chicago Manual of Style.
Author format: Last, First Middle and Last, First Middle (full names)
Institute of Electrical and Electronics Engineers style.
Author format: F. M. Last and F. M. Last (initials before last name - this one's different!)
Create a file dois.txt with your DOIs:
10.1016/j.jaip.2022.05.023
10.1007/s00421-018-3910-3
10.1111/dom.12821
Then run:
python doi_to_bibtex.py --file dois.txt --output references.bibIf you have a CSV file papers.csv:
Title,DOI,Year
Paper 1,10.1016/j.jaip.2022.05.023,2022
Paper 2,10.1007/s00421-018-3910-3,2018Run:
python doi_to_bibtex.py --csv papers.csv --doi-column DOI --output references.bibFor GOST style:
python doi_to_bibtex.py --style gost --file dois.txt --output references_gost.bibGenerate both formats at once:
python doi_to_bibtex.py --file dois.txt --style apa --output refs.bib --text-output refs.txtYou'll get:
refs.bib- BibTeX for LaTeXrefs.txt- Plain text citations ready to copy-paste
The tool accepts DOIs in different formats:
- Plain:
10.1016/j.jaip.2022.05.023 - URL:
https://doi.org/10.1016/j.jaip.2022.05.023 - With quotes:
"10.1016/j.jaip.2022.05.023"
All get normalized automatically, so don't worry about the format.
- Invalid DOIs get skipped (with a warning)
- If Crossref API is down, it'll tell you which DOIs failed
- Missing metadata? It'll still generate what it can
By default there's a 0.5 second delay between API requests to be nice to Crossref. You can change it:
python doi_to_bibtex.py --delay 1.0 10.1016/j.jaip.2022.05.023doibib/
├── doi_to_bibtex.py # Main script
├── requirements.txt # Dependencies
├── README.md # This file
├── README_ru.md # Russian docs
├── utils/ # Helper modules
│ ├── doi.py # DOI normalization
│ ├── crossref.py # Crossref API stuff
│ └── authors.py # Author name formatting
└── styles/ # Citation style formatters
├── standard.py
├── gost.py
├── apa.py
├── chicago.py
└── ieee.py
Found a bug? Want to add a feature? Pull requests welcome. You can also:
- Report issues
- Suggest new citation styles
- Improve docs
- Add features
Open source. Use it for academic/research work.
- Uses Crossref API for metadata
- Built with habanero Python library
Questions or problems? Open an issue on the repo.
Note: This is for academic/research use. Be nice to the Crossref API - don't hammer it with thousands of requests at once. The default rate limiting should help, but use your judgment.