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.
- Pure Python: No external tools like Poppler or
pdftotextrequired. - 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.
📦 Installation
From PyPI (recommended)
pip install bib-extractor
From source
- 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
bib-extractor --dir path/to/papers --output paper_info.json
If 'bib-extractor' is not in your PATH (common on Windows)
python -m bib_extractor --dir path/to/papers --output paper_info.json
- `--dir` defaults to the current working directory.
- `--output` defaults to `paper_info.json`.
### Fetch BibTeX entries & Auto-Rename
```bash
# Fetch entries and automatically rename your PDFs
bib-fetch --input paper_info.json --output papers.bib --rename --dir path/to/papers
# If 'bib-fetch' is not in your PATH
python -m bib_extractor.fetch_bibtex --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.
🤝 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.5.tar.gz.
File metadata
- Download URL: bib_extractor-0.1.5.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
968d978186f84dc6be53c6cd4a4ccd5ca60cd491b66496e1e79e58439e2a0234
|
|
| MD5 |
988cdfb5d024c2049f12731881711772
|
|
| BLAKE2b-256 |
5b1954579f698a17fbacc41809435a63a2f098525702ba08850b2b337638dfba
|
Provenance
The following attestation bundles were made for bib_extractor-0.1.5.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.5.tar.gz -
Subject digest:
968d978186f84dc6be53c6cd4a4ccd5ca60cd491b66496e1e79e58439e2a0234 - Sigstore transparency entry: 1017705711
- Sigstore integration time:
-
Permalink:
msrtarit/bib-extractor@61b81e6f2a5d0d3f509f19d66636083da702eb84 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/msrtarit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61b81e6f2a5d0d3f509f19d66636083da702eb84 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bib_extractor-0.1.5-py3-none-any.whl.
File metadata
- Download URL: bib_extractor-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.5 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 |
fce44fd3b3b9a312c173ef9599f22e9203ab1aec085a224e93dcdc2ba3aa3847
|
|
| MD5 |
4bd651658e26f5ef856bb55194239e75
|
|
| BLAKE2b-256 |
770c0f0bdcda31856e65033fd8daea0a7b453a51dd2ff921020759c93fbc2975
|
Provenance
The following attestation bundles were made for bib_extractor-0.1.5-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.5-py3-none-any.whl -
Subject digest:
fce44fd3b3b9a312c173ef9599f22e9203ab1aec085a224e93dcdc2ba3aa3847 - Sigstore transparency entry: 1017705722
- Sigstore integration time:
-
Permalink:
msrtarit/bib-extractor@61b81e6f2a5d0d3f509f19d66636083da702eb84 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/msrtarit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61b81e6f2a5d0d3f509f19d66636083da702eb84 -
Trigger Event:
release
-
Statement type: