The Python File Format Interface, briefly PyFFI, is an open source Python library for processing block structured binary files:
Simple: Reading, writing, and manipulating complex binary files in a Python environment is easy! Currently, PyFFI supports the NetImmerse/Gamebryo NIF and KFM formats, CryTek's CGF format, the DDS format, and the TGA format.
Batteries included: Many tools for files used by 3D games, such as a stripifier, tangent space calculator, 2d/3d hull algorithms, inertia calculator, as well as a general purpose file editor QSkope (using PyQt4), are included.
Modular: Its highly modular design makes it easy to add support for new formats, and also to extend existing functionality.