Skip to content
LiYunyangPublic

About

BibTeX entry generator from NASA ADS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adsbib

Look up a paper in the NASA ADS and print its BibTeX entry. The entry is also copied to your clipboard. ADS supplies the BibTeX fields; citation keys use FirstAuthorYear, such as Okamoto2003.

Install

Requires Python 3.10 or newer. From this directory, install with pipx:

pipx install .

If adsbib is not found after installation, run pipx ensurepath and open a new terminal.

Use

adsbib "Cosmic microwave background lensing reconstruction on the full sky"
adsbib Cosmic microwave background lensing reconstruction on the full sky
adsbib https://arxiv.org/abs/astro-ph/0301031
adsbib https://arxiv.org/pdf/astro-ph/0301031.pdf
adsbib 2301.12345
adsbib https://arxiv.org/abs/astro-ph/0301031 --lib lensing classics drafts
adsbib "Cosmic microwave background lensing reconstruction on the full sky" --lib lens

--lib adds the selected paper to each named existing ADS library. Put it after the title or URL; quote names containing spaces. The command reports the updated entry count for each library on stderr, keeping stdout as BibTeX for piping. If a paper is already present, it reports Already in with the current count. Library names must match exactly and you need write access; a missing or read-only library is reported before any library is changed.

For example, the status lines look like this (counts will reflect your libraries):

Added to ADS library 'lens': 42 entries
Already in ADS library 'lens': 18 entries

On first use, paste your ADS API token at the prompt. It is saved in ~/.config/adsbib/token with owner-only permissions, and later calls reuse it. This is the only API key required. To change it, run adsbib --set-token. You can also set ADS_API_TOKEN in the environment instead of saving a token.

On macOS the command uses pbcopy. On Linux it tries wl-copy, xclip, then xsel; install one of these for clipboard support. On Windows it uses clip. If copying fails, the BibTeX entry still appears in the terminal and the command exits with an error.

ADS may return several papers for an incomplete title. adsbib chooses the closest title among the first ten results and prefers a published record when titles match. Check the result before citing it.

Development

python -m pip install -e '.[test]'
pytest

About

BibTeX entry generator from NASA ADS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages