This is a collection of code that I use across projects. Versions of it are distributed with code releases (e.g. http://code.google.com/p/berkeley-parser-analyser/), but this is the version I am currently using.
To use any of these classes or functions just set up a symbolic link like so:
ln -s "path/to/git"/src util
and then just include in your code a line like:
sys.path.insert(0, "util")
Yes, it's a hacky way of doing things, but it's simple. For examples see the tools.