Are you tired of copying, pasting, and hopping between websites while preparing your bibliography? As high-energy physicists, we have plenty of other things to worry about. Let this Python script update your BibTeX file using official InspireHEP records. It automatically matches entries by arXiv ID, DOI, or title+year, and logs any citation key changes for easy LaTeX file updates.
- Batch updates all BibTeX entries from InspireHEP
- Searches in order: arXiv, DOI, then title+year
- Works with any BibTeX entry type
- Logs citation key changes (
old_key → new_key) tocitation_key_changes.log - Backs up your original
.bibasfilename-old.biband writes updates to the original filename - Quiet by default; enable per-entry logs with
--verbose
pip install bibtexparser requests tqdmpython inspireCitation.py [options] <bibfile><bibfile>: your BibTeX file (e.g.reference.bib)- Options:
-v,--verboseEnable per-entry 🔎/✅/❌ logs
Example:
# quiet (default)
python inspireCitation.py reference.bib
# verbose output
python inspireCitation.py reference.bib --verboseAfter running:
-
Your original
reference.bibis renamed toreference-old.bib -
Updated entries are written to
reference.bib -
If any keys changed, see
citation_key_changes.log:oldkey1 -> newkey1 oldkey2 -> newkey2
The updated reference.bib now exactly matches the citations from InspireHEP. Enjoy!
- For best results, you just need to make sure that there is an
arxivordoifield in each bibliography entry Title+yearmatching is a fallback when no arXiv ID or DOI is found.
Enjoy a smoother bibliography workflow 🍶🥃
