mkogg.py: Fix 'self.get_mp4_metadata(self, source)'
[blog.git] / posts / Pybtex.mdwn
1 [[!template id=bzrrepo repo=pybtex]]
2
3 I keep my [[BibTeX]] databases neat and tidy with my own branch of
4 [Pybtex][].  The actual command used to re-format the files is
5
6     $ python -c 'from pybtex.database.input.bibtex import Parser; from pybtex.database.output.clean_bibtex import Writer; p = Parser(); d = p.parse_file("path/to/db.bib"); w = Writer(); w.write_file(d, "path/to/db.bib", p.get_raw_macros())' 2> pybtex.log
7
8 Be sure to look over `pybtex.log` and `git diff path/to/db.bib` for
9 anything suspicious before committing the new file (you are versioning
10 it with [[Git]] right? ;).  You may have to do some find-and-replacing
11 to handle changed keys and consolidate or rename automatically
12 generated macros.
13
14 You might also be interested in [bibtool][], but I'm more comfortable
15 tweaking things in [[Python]].
16
17
18 [Pybtex]: http://pybtex.sourceforge.net/
19 [bibtool]: http://www.ctan.org/tex-archive/biblio/bibtex/utils/bibtool/
20
21
22 [[!tag tags/latex]]
23 [[!tag tags/programming]]
24 [[!tag tags/python]]
25 [[!tag tags/tools]]