Paul Sladen's pyflate from http://www.paul.sladen.org/projects/compression/