Bibmanager: A BibTex Manager Designed for Astronomers

Patricio Cubillos is a post-doctoral researcher at the Space Research Institute in Graz, Austria. He works on exoplanet atmospheric characterization. He is also a tea enthusiast.

A couple of years ago, I wanted to write a script to sort the entries of that massive BibTeX file that we all have. After stumbling on tutorials for the new ADS and pytest, I ended up making Bibmanager, a command-line based application for BibTeX management.

At its core, Bibmanager is a BibTex database that keeps all of your entries in a single place. This design allows the code to automate tedious tasks, such as removing duplicates, synchronizing with ADS, and generating BibTeX files when compiling a LaTeX document. It also doubles as a PDF database, allowing you to directly fetch them from ADS. Below are some of the features:

Getting started is as convenient as merging your bib files into the database (bibm merge):
bibm mergeThe user can also add entries manually by copy-pasting them (bibm add), or directly editing the database (bibm edit).

Thanks to the amazing new ADS interface, Bibmanager enables searches in ADS just as if you were on the ADS browser (bibm ads-search). Then, the feature allows the user to add entries directly from ADS by specifying their ADS bibcode:
bibm ads-searchAutocomplete features show you the available search fields, making it convenient to search for the entry you want as you type.

Bibmanager also automatically generates a bib file when compiling a LaTeX document. This bib file only contains the entries cited in the LaTeX file. The bibm latex or bibm pdflatex commands let the user choose to compile with either the latex or pdflatex directive:
bibm latexIf there were citations not found in the database, the code alerts you at the end.
Alternatively, the bibm bibtex command allows the user to get only the bib file without compiling.

Once the user has built a database, the bibm search command makes it possible to search entries by different fields:
bibm searchThe syntax is similar to an ADS search.

Have I mentioned that the new ADS interface is amazing? Because it seriously is. Thanks to this interface, the bibm ads-update command updates your entire BibTex database against the current ADS database, in a single command:

So, forget about those outdated ArXiv entries. If you are not into having a BibTex database, the bibm cleanup command does the duplicate removal and ADS update for your own bib files, so no need for compromises.

Finally, Bibmanager can also keep a database of the PDF files associated with the BibTeX entries. The user can manually link a PDF file to the entries via the bibm pdf command, open it through the bibm open command, and directly fetch a PDF from ADS through the bibm fetch command:
bibm fetchAll of these commands have autocompletion features to make it possible to search for the right entry/bibcode. Also, as long as the user provides a valid bibcode, you can fetch any PDF (no need for it to be an entry in the database).

Bibmanager is compatible with Python3.6+ (pip install bibmanager), has been tested to work in both Linux and OS X, and is fully documented (with lots of examples) at Bibmanager website. The code is open source under the MIT license. See also this tutorial video on YouTube:

Have any questions? Take a look at the FAQ. Still more questions? What features would you like to see? Comment below or email Patricio at pcubillos[at] Also feel free to open issues and pull requests on the Github repository!

1 comment… add one
  • Moritz Feb 27, 2020 @ 15:17

    I’ve recently discovered adstex ( which generates .bib files by downloading the info from the ADS by parsing the citation keys in the tex file. The philosophy behind it is a little different (adstex aims NOT to have a local database because it gets the data form the ADS), but there are nice feature in here (getting the pdf to read) that would be nice to have in adstex, and in adstex that would be nice here (adstex tries to parse citation keys that are e.g. DOIs, author_date keys etc.).
    It would be great if you guys could collaborate and give us all features in one place!

Leave a Reply

Your email address will not be published. Required fields are marked *