Metadata-Version: 2.4
Name: antifile
Version: 0.1.0
Summary: Extract BibTeX metadata from PDFs, EPUBs, URLs, and identifiers
Project-URL: Homepage, https://github.com/vxvware/antifile
Project-URL: Repository, https://github.com/vxvware/antifile
Project-URL: Issues, https://github.com/vxvware/antifile/issues
Author-email: VxVware <trevor.j.vincent@gmail.com>
License-Expression: MIT
Keywords: arxiv,bibliography,bibtex,citations,doi,epub,isbn,metadata,pdf
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing :: Markup :: LaTeX
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Requires-Dist: bibtexparser>=2.0.0b7
Requires-Dist: httpx>=0.27
Requires-Dist: pymupdf>=1.24
Requires-Dist: rapidfuzz>=3.0
Requires-Dist: rich>=13.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# antifile

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

## Install

```bash
pip install antifile
# or
uv tool install antifile
```

## Usage

```bash
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 **URL** — `antifile https://example.com/article -o refs.bib`
- a **DOI** — `antifile 10.1145/3292500 -o refs.bib`
- an **arXiv ID** — `antifile arXiv:1706.03762 -o refs.bib`
- an **ISBN** — `antifile 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}` | 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 can fall back to an LLM to read
the first page. Set whichever API key you have — it's picked up from the
environment:

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

## Related

- [antilibrary](https://github.com/vxvware/antilibrary) — manage BibTeX libraries from the terminal (can call antifile via `--add-from-files`).
- [antifind](https://github.com/vxvware/antifind) — online metadata search → BibTeX.

## License

MIT
