Magazine · 2008
Python Tutorial -- Handling Bibliography with Python
Vassilios Karakoidas
The third Python tutorial: parsing BibTeX. A small class, a hand-written parser, and a walk over a directory tree — enough to do something useful with a bibliography.
- Published in
- Linux Format (Greek version), 2008
- Citations
- Not indexed by Google Scholar.
- Cite as
- LX08-3
What it builds
A BibtexEntry class and a parser for the BibTeX format — entry type, key and the key/value fields — plus an os.walk() over a directory to find every .bib file and a search across what it collects. BibTeX is a good tutorial subject precisely because it is a small, real, slightly awkward format: the piece is as much about writing a parser for something you did not design as it is about Python.
Where it sits
The library it became is biblio.py. The next instalment puts a window in front of it.
Written from the paper itself — the PDF linked above, which this site hosts.