To get a bit more accustomed with web development in Python, I started trying out Flask1, a ‘micro-framework’ for web development.
My previous academic homepage had a publication list backed by a CMS, so I thought porting everything to a stand-alone website would be a little cumbersome – but it wasn’t.
My requirements for the publication list were simple:
Apart from that, I also wanted to have some simple way to blog, so I followed this nice tutorial on how to set up a mark-down based blog with Flask.2
Then, I just grabbed Python’s bibtexparser package and was good to go:
Apart from dealing with character escaping in BibTex (see line 55; this works for me but should be generalized) and the sorting of references, everything worked out of the box.
I could imagine that this setup scales nicely to large BibTex files and even whole research groups, as you can generate static websites from a Flask app (didn’t try that yet). It seems particularly useful if everyone in the group is already working with BibTex (and who doesn’t? ;-).
Since BibTex is happy with custom fields, it is also quite easy to integrate additional information that is only relevant for the website. For example, I am using a preprint field for paths to preprint files. The bibtexparser picks those fields up automatically.
A Jinja template for the publications list could look like this:
So, Flask is indeed as ‘micro’ as possible, at least when it comes to simple websites… :-)
Of course I gave Django a spin as well, but I don’t really need most features and thus decided to keep it simple. ↩