The Python File Format Interface, briefly PyFFI, is an open source Python library for processing block structured binary files:
Get PyFFI from Sourceforge, or install it with:
easy_install -U PyFFI
To get the latest (but possibly unstable) code, clone PyFFI from its Git repository:
git clone --recursive git://github.com/amorilia/pyffi.git
Be sure to use the --recursive flag to ensure that you also get all of the submodules.
If you wish to code on PyFFI and send your contributions back upstream, get a github account and fork PyFFI.