Skip to main content

Extract BibTeX metadata from PDFs, EPUBs, URLs, and identifiers

Project description

antifile

Extract BibTeX metadata from PDFs, EPUBs, URLs, and identifiers (DOI, arXiv, ISBN) and append it to a .bib file.

Install

pip install antifile
# or
uv tool install antifile

Usage

antifile INPUT -o refs.bib

INPUT can be:

  • a PDF or EPUB file — antifile paper.pdf -o refs.bib
  • a folder of PDFs/EPUBs — antifile ~/Downloads/papers -o refs.bib (add --recursive to descend into subfolders)
  • a URLantifile https://example.com/article -o refs.bib
  • a DOIantifile 10.1145/3292500 -o refs.bib
  • an arXiv IDantifile arXiv:1706.03762 -o refs.bib
  • an ISBNantifile 9780262033848 -o refs.bib

Entries are appended with de-duplication: a new entry matching an existing one (by DOI, arXiv ID, ISBN, or normalized title+author) fills in any missing fields rather than creating a duplicate. Pass --no-merge to skip on duplicate, or --force to append anyway with an auto-suffixed key.

Options

flag effect
-o, --output FILE target .bib (required; created if missing)
--method {auto,doi,arxiv,isbn,crossref,llm,claude-code,codex} force a PDF extraction method (default: auto)
--recursive recurse into subfolders for folder input
--no-preview skip the first-page PDF preview
--no-merge on duplicate, skip instead of filling missing fields
--force append even if a duplicate exists

LLM-assisted extraction

When a PDF has no resolvable identifier, antifile falls back to an LLM to read the first page. Set whichever API key you have — it's picked up from the environment:

export ANTHROPIC_API_KEY=...   # or OPENAI_API_KEY, or GEMINI_API_KEY / GOOGLE_API_KEY

With no API key set, antifile falls back to a CLI agent if one is installed — first the claude CLI, then the codex CLI. Each tier is skipped if its binary isn't on your PATH. Full chain:

DOI → arXiv → ISBN → CrossRef title → LLM API → claude CLI → codex CLI → none

Related

  • antilibrary — manage BibTeX libraries from the terminal (can call antifile via --add-from-files).
  • antifind — online metadata search → BibTeX.

License

MIT

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

antifile-0.1.3.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

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

antifile-0.1.3-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file antifile-0.1.3.tar.gz.

File metadata

  • Download URL: antifile-0.1.3.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for antifile-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7d8b1a541969caf34b727a9f43e8ae3339a111cf241006960f4815a1cea1fdb1
MD5 c27f7bb9f6fa231df46fdf147514162c
BLAKE2b-256 7be9d3b2948a8db7003a5a976dd9f0ec81518a39416dc880e8a3bf93b4ebfcb8

See more details on using hashes here.

File details

Details for the file antifile-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: antifile-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for antifile-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2557470ba1ce7bb519433320ec4206541e2aba0ee1e159448b5882964f5ff735
MD5 7a3ebf07a09fbc0af796bbed968b6faf
BLAKE2b-256 361d0f57eec8171fee8c28d4a90e3953504de6841d5769f9ff2c70074b1bf97b

See more details on using hashes here.

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