We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

The encodings.zlib_codec Module

(New in 2.2) ZIP codec. Let’s you use the encode and decode string methods to compress and decompress data, instead of importing the zlib module (but note that the module lets you set more parameters, especially when compressing data).

compressed_data = data.encode("zlib")
decompressed_data = compressed_data.decode("zlib")

import zlib
compressed_data = zlib.compress(data)
decompressed_data = zlib.decompress(compressed_data)