Fetch BibTeX from DOI, arXiv ID, journal URL and article title
Project description
doi2bib3
doi2bib3 is a small Python utility to fetch BibTeX metadata for a DOI or to resolve arXiv identifiers to DOIs and fetch their BibTeX entries. It accepts DOI inputs, DOI URLs, arXiv IDs/URLs (modern and legacy), publisher landing pages, and uses a sequence of resolution strategies to return a BibTeX string. This tool combines the features of doi2bib and doi2bib2.
Key behaviors
- Accepts DOI, DOI URL, arXiv ID/URL, publisher URL, or article-title text.
- Resolves inputs to a DOI using URL metadata, arXiv metadata, Crossref lookup, and DOI content negotiation with Crossref fallback.
- Normalizes BibTeX output, including journal abbreviation mappings and selected publisher-specific cleanup.
- Full pipeline documentation (input -> output):
docs/ALGORITHM.md - Diagram version of the pipeline:
docs/ALGORITHM_VISUALS.md
A cross-platform GUI frontend is available: Check out QuickBib and its webapp.
Installation
Install from pypi
pip install --user doi2bib3
Arch Linux
In Arch Linux you can install it from the AUR with the command yay -S python-doi2bib3.
Ubuntu
You can use our official PPA
sudo add-apt-repository ppa:apandada1/quickbib
sudo apt update
sudo apt install python3-doi2bib3
Installing from source
Create a virtual environment and install runtime dependencies:
git clone https://github.com/archisman-panigrahi/doi2bib3.git
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Install the package for local development:
pip install -e .
CLI usage
The CLI accepts a single positional identifier and an optional -o/--out
path to save the BibTeX output. When installed, the package installs a console
script named doi2bib3 (configured in pyproject.toml). From the repository
root you can run the local script wrapper at scripts/doi2bib3.
# using the local wrapper script from repo root
python scripts/doi2bib3 <identifier> [-o OUT]
# or when installed as console script
doi2bib3 <identifier> -o references.bib
Examples
Fetch by DOI (bare DOI or DOI URL):
doi2bib3 10.1038/nphys1170
doi2bib3 https://doi.org/10.1038/nphys1170
ArXiv inputs (detected automatically):
doi2bib3 https://arxiv.org/abs/2411.08091
doi2bib3 arxiv.org/abs/2411.08091
doi2bib3 www.arxiv.org/abs/2411.08091
doi2bib3 arXiv:2411.08091
doi2bib3 2411.08091
doi2bib3 hep-th/9901001
Name of the paper (includes fuzzy search):
doi2bib3 "Projected Topological Branes"
Publisher/article pages (Supports APS, AMS, ACS, IOP Science, Nature, PNAS, SciPost, and ScienceDirect journals):
doi2bib3 https://www.pnas.org/doi/10.1073/pnas.2305943120
doi2bib3 https://iopscience.iop.org/article/10.1088/1402-4896/ad995f/pdf
doi2bib3 https://www.scipost.org/SciPostPhys.20.3.082/
doi2bib3 https://www.scipost.org/SciPostPhys.20.3.082/pdf
doi2bib3 https://www.sciencedirect.com/science/article/pii/S0003491605000096?via%3Dihub
Save to a file:
doi2bib3 https://doi.org/10.1038/nphys1170 -o paper.bib
Note: If the tool is not installed, you can run python scripts/doi2bib3 https://doi.org/10.1038/nphys1170.
Supported journal groups
doi2bib3 directly supports many APS, AMS, ACS, Nature, PNAS, SciPost, ScienceDirect and IOP groups of journals.
For other journals, the DOI link works, but the paper's URL would not work..
Programmatic usage
Public API
The Python API exposes one primary function:
doi2bib3.fetch_bibtex(identifier: str, timeout: int = 15) -> str
Example:
from doi2bib3 import fetch_bibtex
bib = fetch_bibtex('https://www.pnas.org/doi/10.1073/pnas.2305943120')
print(bib)
Programmatic CLI entry
Use subprocess with scripts/doi2bib3 (or installed doi2bib3 command)
for automated CLI tests.
Internal module layout
doi2bib3/backend.py: input resolution and network fetch logicdoi2bib3/normalize.py: BibTeX normalization/transformsdoi2bib3/io.py: file output helpersscripts/doi2bib3: command-line argument parsing and output handling
License
This project is distributed under the GNU General Public License v3 (GPL-3.0-only).
Acknowledgements
Parts of the code and documentation were assisted by copilot and codex.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file doi2bib3-1.1.1.tar.gz.
File metadata
- Download URL: doi2bib3-1.1.1.tar.gz
- Upload date:
- Size: 33.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3efa5da5fdc70c4300814604efa3249bbbe544fff707c718e5fb57fa9833309
|
|
| MD5 |
de5a78943d73ddc6cc27188705c0a143
|
|
| BLAKE2b-256 |
29b2e2da5a0bc3658681577032821c46dfaa96dc4366ef138521db473c01f43c
|
File details
Details for the file doi2bib3-1.1.1-py3-none-any.whl.
File metadata
- Download URL: doi2bib3-1.1.1-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a36824e5615cd1cd517067624b41b1799e5e3b330dab76cba17fdafd4053d402
|
|
| MD5 |
6ad703403e6abb390267c752be7f216b
|
|
| BLAKE2b-256 |
e97bb1c2b89e54f623d3f8501196f1d874a373c1c9c77377dbfa3b83f79ea57e
|