Extract DOIs or titles from PDF papers and generate a BibTeX bibliography
Project description
Bib Extractor
A tiny, pip‑installable Python utility that scans a folder of PDF papers, extracts their DOI (or a title fallback), and produces a JSON file that can be turned into a BibTeX bibliography.
✨ Features
- Works on any folder of PDFs.
- Uses
pdftotext(Poppler) to read text from PDFs. - Detects DOI strings with a robust regular expression.
- Multiple API Support: Queries
doi.organd falls back to Crossref for metadata. - Auto-Rename: Automatically renames PDFs to
Year - Author - Title.pdf. - Formatted Citations: Generates APA/MLA style reference lists in a separate text file.
- Visual Progress: Includes a terminal progress bar for high‑volume processing.
- Zero external Python dependencies (standard library only).
📦 Installation
From PyPI (recommended)
pip install bib-extractor
From source
- Install Poppler –
pdftotextis required.- Windows: download from https://github.com/oschwartz10612/poppler-windows/releases and add the
binfolder to yourPATH. - macOS:
brew install poppler - Linux:
sudo apt-get install poppler-utils
- Windows: download from https://github.com/oschwartz10612/poppler-windows/releases and add the
- Clone the repository
git clone https://github.com/msrtarit/bib_extractor.git
cd bib_extractor
- (Optional) Create a virtual environment and install the package in editable mode:
python -m venv .venv
.venv\\Scripts\\activate # Windows
# or source .venv/bin/activate on Unix
pip install -e .
🚀 Usage
Extract DOIs / titles
# Using the installed command (if installed via pip)
bib-extractor --dir path/to/papers --output paper_info.json
# Or run the script directly from the source checkout
python extract_bib_info.py --dir path/to/papers --output paper_info.json
--dirdefaults to the current working directory.--outputdefaults topaper_info.json.
Fetch BibTeX entries & Auto-Rename
# Fetch entries and automatically rename your PDFs
bib-fetch --input paper_info.json --output papers.bib --rename --dir path/to/papers
--input: The JSON file from the extractor.--output: The destination.bibfile.--citations: (Optional) Output file for a formatted reference list (e.g.,refs.txt).--style: (Optional) Citation style for the list (apaormla, default isapa).--rename: (Optional) Automatically renames the files in--dirto a standard format:Year - Author - Title.pdf.--dir: (Required if renaming) The folder where your original PDFs are located.
The extractor prints progress and writes a JSON array like:
[
{"file": "1.pdf", "doi": "10.1109/XYZ.2023.123456"},
{"file": "2.pdf", "title": "An Interesting Study on …"}
]
Next steps
- Convert the generated
.bibfile to the citation style you need. - Extend the workflow with additional scripts or integrate into your bibliography manager.
🤝 Contributing
Please see the CONTRIBUTING.md for guidelines on how to fork the repo, set up a development environment, and submit pull requests.
📜 License
This project is licensed under the MIT License – see the LICENSE file for details.
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 bib_extractor-0.1.3.tar.gz.
File metadata
- Download URL: bib_extractor-0.1.3.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ce6c2772cbd9b0c064c7bf971e876c24fd83348443895558c1ce2eae088c50c
|
|
| MD5 |
faba8df8ef6264ea28b56d3d9a24911e
|
|
| BLAKE2b-256 |
f4a456ba3bfbb55e592272ac42b898820b96200813b4c708f975cf515ae6542e
|
Provenance
The following attestation bundles were made for bib_extractor-0.1.3.tar.gz:
Publisher:
publish.yml on msrtarit/bib-extractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bib_extractor-0.1.3.tar.gz -
Subject digest:
8ce6c2772cbd9b0c064c7bf971e876c24fd83348443895558c1ce2eae088c50c - Sigstore transparency entry: 1017494521
- Sigstore integration time:
-
Permalink:
msrtarit/bib-extractor@92d04cb116aad4730805ac93a6758c2dbb6d7f8f -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/msrtarit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92d04cb116aad4730805ac93a6758c2dbb6d7f8f -
Trigger Event:
release
-
Statement type:
File details
Details for the file bib_extractor-0.1.3-py3-none-any.whl.
File metadata
- Download URL: bib_extractor-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15a48fa84f9011e2eb3691b1470bfeb510ec2c2cc7e3c1322348e1369ffbe1bd
|
|
| MD5 |
722c71a9136860cae77157532d5e77d7
|
|
| BLAKE2b-256 |
25eb6f11b7b37e75564494d8d7b3eaba6ba77fab8dcffd7beca70968f1296bc9
|
Provenance
The following attestation bundles were made for bib_extractor-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on msrtarit/bib-extractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bib_extractor-0.1.3-py3-none-any.whl -
Subject digest:
15a48fa84f9011e2eb3691b1470bfeb510ec2c2cc7e3c1322348e1369ffbe1bd - Sigstore transparency entry: 1017494570
- Sigstore integration time:
-
Permalink:
msrtarit/bib-extractor@92d04cb116aad4730805ac93a6758c2dbb6d7f8f -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/msrtarit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92d04cb116aad4730805ac93a6758c2dbb6d7f8f -
Trigger Event:
release
-
Statement type: