Publicly available, free, complete database for antibiotics names and classes? This is a tough one I think: is there a publicly available, up-to-date, free, complete database for antibiotics names and classes?

I am specifically looking for information like, e.g., cefpirome (is a) cephalosporin.

I've looked in a couple of different places, but nothing really comes close. E.g.:


CARD comes closest, but is not free (companies need to pay a license) and not complete/up-to-date (e.g., cefpirome is missing)
@Karel mentioned KEGG in his answer, but this also needs a license (companies for sure, academics if they download data via FTP).
Novel Antiobiotics Database has no class ... and stops in 2003
The Antimicrobial Index is web only, and terms of use apparently prohibit any kind of web-scraping.
A suggestion by @Pierre on Twitter was to try Antimicrobial stubs on Wikipedia. Good idea, but the class is not stored in the ChemBox and must be free-text parsed. Or writing a script which evaluates the Wikipedia category tags.
I drew blank at different government agencies (EMA, FDA, EFSA, NIH, etc.). The closest I found was from the WHO a list of critically important antibiotics. But not complete, and in a PDF.


Any pointer appreciated.
ChEBI

It should be possible to get this information from the ChEBI database, see the exported tables. You could download the ontologies (in OWL / OBO), parse them using some ad-hoc parser or using a dedicated library (e.g., Pronto), build a directed acyclic graph based on the is_a relationship, and extract the antibiotic subtree.

KEGG 

You could also use KEGG: Kyoto Encyclopedia of Genes and Genomes, but a subscription is probably required. The exported drug table should be easy to parse (e.g., in Python).

For a quick verification of the completeness, you can download the table, filter out everything except antibacterial agents and check the number of records:

curl "ftp://ftp.genome.jp/pub/kegg/medicus/drug/drug" &gt; keg_all.txt

cat keg_all.txt \
   | perl -pe 's/\n/BREAK/g' \
   | perl -pe 's@///BREAK@///\n@g' \
   | grep 'CLASS       Antibacterial' \
   | perl -pe 's/BREAK/\n/g' \
   &gt; keg_antibacterial.txt

cat keg_antibacterial.txt | grep "///" | wc -l


There are 646 records. However, some of them are almost identical (e.g., only 1 atom difference).

If you add | grep -i "antibiotic" \ to the pipeline, then you get only 445 records.