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)

A Django site. rendered by a django application. hosted by webfaction.