Skip to main content

Manage BibTeX libraries from the terminal

Project description

antilibrary

antilibrary

Manage a BibTeX file from the terminal.

Install

pip install antilibrary
# or
uv tool install antilibrary

Usage

Antilibrary manages one or more libraries — each a .bib file with an optional folder for associated files (PDFs, EPUBs, …). Libraries live in ~/.config/antilibrary/config.toml (override with $ANTILIBRARY_CONFIG).

# Register a library (the first one becomes the default)
antilibrary library add main --bib ~/refs/main.bib --files ~/refs/files
antilibrary library add movies --bib ~/media/movies.bib   # no files folder

antilibrary library list                 # show configured libraries
antilibrary library set-default movies   # change the default
antilibrary library remove movies        # forget a library (add --purge to delete its files)

Once a default is set, the entry commands operate on it. Use -l/--library NAME to target another:

antilibrary add                          # interactively add an entry
antilibrary add -l movies                # add to the movies library
antilibrary get smith2024                # print citation for a key
antilibrary browse                       # list entries
antilibrary browse -q "attention"        # fuzzy search
antilibrary browse -t "nlp,transformers" # filter by tags
antilibrary remove smith2024             # delete an entry (+ its managed file)

The library is resolved in this order: -l/--library NAME, then -f/--file FILE (ad-hoc, no files folder), then $ANTILIBRARY_BIB, then the configured default.

Associated files

If a library has a files folder, attaching a file copies it there and renames it to the entry's key (e.g. smith2024.pdf); the entry's file field stores the relative name. If the library has no files folder, the file is left in place and file stores its absolute path. Removing an entry deletes its managed file (pass --keep-file to keep it).

antilibrary add --attach ~/Downloads/paper.pdf   # attach during interactive add

Citation styles

antilibrary get KEY --style {bibtex|bibtex-full|latex|org-cite|pandoc} prints a citation in the requested format:

style output
bibtex smith2024
bibtex-full the whole entry
latex \cite{smith2024}
org-cite [cite:@smith2024]
pandoc [@smith2024]

Adding entries

antilibrary add is interactive — it prompts for type, title, author, year, key, and any extra fields. Adding an entry that matches an existing one (by DOI, arXiv ID, ISBN, or normalized title+author) silently fills any empty fields on the existing entry rather than creating a duplicate. Pass --no-merge to skip on duplicate, or --force to append anyway with an auto-suffixed key.

Bulk add from files or online search

Antilibrary integrates with its two companion tools:

  • antifile — extract BibTeX from PDFs, EPUBs, URLs, DOIs, arXiv IDs, or ISBNs.
  • antifind — online search (movies, TV, music, papers, books) → BibTeX.

Install them as extras:

pip install 'antilibrary[files]'    # antifile
pip install 'antilibrary[search]'   # antifind
pip install 'antilibrary[all]'      # both

Then add entries in bulk. Files that resolve to a real path are attached using the library's files-folder rules:

antilibrary add --add-from-files paper.pdf book.epub 10.1145/3292500
antilibrary add --add-from-search "attention is all you need" --kind papers --limit 3

For PDFs, antifile resolves metadata by identifier (DOI / arXiv / ISBN) or a CrossRef title match. When none of those work it falls back to an LLM: set ANTHROPIC_API_KEY (or OPENAI_API_KEY / GEMINI_API_KEY) and that key is passed through. With no key set, it still tries the claude CLI if it's on your PATH.

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

antilibrary-0.3.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

antilibrary-0.3.3-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file antilibrary-0.3.3.tar.gz.

File metadata

  • Download URL: antilibrary-0.3.3.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • 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 antilibrary-0.3.3.tar.gz
Algorithm Hash digest
SHA256 4300229f048c68d85671987d969c416980a2b6ad2b91c8fa7992a4e25ac0ec04
MD5 7c9fb285b2263e6f175da418785d93f2
BLAKE2b-256 8077f8abeb660fd02f5c0d371dc9c6ba4ac390209cb84abe84ec65f02a0a734e

See more details on using hashes here.

File details

Details for the file antilibrary-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: antilibrary-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 23.0 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 antilibrary-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ce6d7b676d131a54d38e1b3da9833288e75ceaa9dd85866ac1fa699d6fb0a6c4
MD5 3559bf8a904746ce5b7b989a0831d91e
BLAKE2b-256 c5424cc6eca61e083c69681fc2cfe12d252c2a23b2ab8d523ef80464bec8c857

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