Skip to main content

Extract DOIs or titles from PDF papers and generate a BibTeX bibliography

Project description

Bib Extractor

PyPI version License: MIT

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 pdftotext required.
  • Detects DOI strings with a robust regular expression.
  • Multiple API Support: Queries doi.org and 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

  1. Clone the repository
git clone https://github.com/msrtarit/bib_extractor.git
cd bib_extractor
  1. (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 -m bib_extractor.extract_bib_info --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

# 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 .bib file.
  • --citations: (Optional) Output file for a formatted reference list (e.g., refs.txt).
  • --style: (Optional) Citation style for the list (apa or mla, default is apa).
  • --rename: (Optional) Automatically renames the files in --dir to 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bib_extractor-0.1.4.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bib_extractor-0.1.4-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file bib_extractor-0.1.4.tar.gz.

File metadata

  • Download URL: bib_extractor-0.1.4.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

Hashes for bib_extractor-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b3bcbb02d4195da22fc6e963488ceb6bdf37f4c668de7c359b33acce1f9f8893
MD5 5552513f547feea381a72f9471b42952
BLAKE2b-256 49732b2945c5b8d0f5d6babab7bebf4f54621ee7055911bd9484ad8eccb5a171

See more details on using hashes here.

Provenance

The following attestation bundles were made for bib_extractor-0.1.4.tar.gz:

Publisher: publish.yml on msrtarit/bib-extractor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bib_extractor-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: bib_extractor-0.1.4-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

Hashes for bib_extractor-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b9db9e8f16da94be86b1d76403156370b712754dd07b5d72eebcbbe2e1bb852b
MD5 628b39a4accf3b656e0eee504fdfc18d
BLAKE2b-256 fcbd46fbfe441e26595e84ac303f2d6b25f0f9a670b826eecfa56f05777de5a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for bib_extractor-0.1.4-py3-none-any.whl:

Publisher: publish.yml on msrtarit/bib-extractor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page