bibcheck is a python script that reads a bibTeX file the way BibTeX does—braces inside quotes, #-concatenation, bare @string aliases—and reports what is wrong with it: aliases used but never defined, keys used twice, entries whose braces do not close, entries missing the fields their type requires, the same paper filed under two keys (caught by a shared doi).
It was written for the sanitation of sci.bib ahead of its expansion into wiki templates, where a duplicate key becomes two edits fighting over one page and an undefined alias becomes a journal rendering as a bare word. On its first pass over the 4917 entries it reported 34 undefined aliases, 8 malformed fields, 11 shared dois (five of which were wrong dois, copied from a neighbouring paper and corrected against CrossRef)—and, entry counts agreeing with Emacs's bibtex-count-entries to the unit, the confidence that the parse itself was sound. The file has read Nothing to report since.
bibcheck # ~/bib/sci.bib, all checks
bibcheck FILE # another file
bibcheck --only dup-key # one check (repeatable); --list names the twelve
bibcheck -q # counts only
Exit status 1 if anything at ERROR level was found, so it can gate a pipeline. It only ever reads: nothing is rewritten.
Written on 9 August (2026). Some classes of defect it does not see, having learnt them the hard way the same day: ASCII-lookalike punctuation (a U+2010 hyphen splitting one author into two wiki pages, thin spaces between initials doing the same for forty), accents whose backslash went missing (Mu{~n}oz), and ISO-2022 escape bytes fossilised by some ancient encoding conversion. Those were hunted with one-off sweeps; teaching them to bibcheck is the natural next version.