BibTeX capital preservation fixer upper in Python