Skip to main content

Automatically fetch BibTeX entries from INSPIRE and ADS for LaTeX projects

Project description

easybib

Tests codecov

Automatically fetch BibTeX entries from INSPIRE and NASA/ADS for LaTeX projects.

easybib scans your .tex files for citation keys, looks them up on INSPIRE and/or ADS, and writes a .bib file with the results. It handles INSPIRE texkeys (e.g. Author:2020abc) and ADS bibcodes (e.g. 2016PhRvL.116f1102A).

Installation

pip install easybib

Usage

easybib /path/to/latex/project
easybib paper.tex

Pass a directory to scan all .tex files recursively, or a single .tex file. BibTeX entries are fetched and written to references.bib.

Options

Flag Description
-o, --output Output BibTeX file (default: references.bib)
-s, --source Preferred source: ads (default), inspire, or auto
-a, --max-authors Truncate author lists (default: 3, use 0 for no limit)
-l, --list-keys List found citation keys and exit (no fetching)
--fresh Ignore existing output file and start from scratch
--ads-api-key ADS API key (overrides ADS_API_KEY environment variable)

Examples

# Scan a directory
easybib ./paper -s inspire

# Scan a single file
easybib paper.tex

# Use a custom output file
easybib ./paper -o paper.bib

# List citation keys without fetching
easybib ./paper -l

# Keep all authors
easybib ./paper -a 0

ADS API key

When using ADS as the source (the default), provide your API key either via the command line:

easybib ./paper --ads-api-key your-key-here

Or as an environment variable:

export ADS_API_KEY="your-key-here"

Get a key from https://ui.adsabs.harvard.edu/user/settings/token.

How it works

  1. Scans .tex files for \cite{...}, \citep{...}, \citet{...}, and related commands
  2. Filters for keys containing : (INSPIRE/ADS format)
  3. Fetches BibTeX from the preferred source, with automatic fallback
  4. Replaces citation keys to match those used in your .tex files
  5. Truncates long author lists
  6. Skips keys already present in the output file (use --fresh to override)

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

easybib-0.2.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

easybib-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file easybib-0.2.0.tar.gz.

File metadata

  • Download URL: easybib-0.2.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for easybib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 65bedc3a1f9a53a9c5b5a207dc3bfa271321b50b08a0d28ab5a77007f87b02e2
MD5 d9086add1d5cfc7a697b664782b5fde3
BLAKE2b-256 c23435eb9e18ff7e8f9f186bd3abb1f1a1344512073b904a428501dcf40b7978

See more details on using hashes here.

File details

Details for the file easybib-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: easybib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for easybib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2068e3c6c22ed0531cdfae868f8aa83d9a98c4382644262c14a9d66e3a5dae5d
MD5 8ed64101976f801da07b663823a93c2e
BLAKE2b-256 69d32c351388bef8610f7fa761bcabb89315b62f24a2ea89a0c0b4588f3376c8

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