Data Compression

tarfile — Read and write tar archive files

Source code: Lib/tarfile.py

zipfile — Work with ZIP archives

Source code: Lib/zipfile.py

lzma — Compression using the LZMA algorithm

Source code: Lib/lzma.py

bz2 — Support for bzip2 compression

Source code: Lib/bz2.py

gzip — Support for gzip files

Source code: Lib/gzip.py

zlib — Compression compatible with gzip

For applications that require data compression, the functions in this module allow compression and decompression, using the zlib library. The zlib library has its own home page at https://www.zlib.net. There are known incompatibilities between the Python module and versions of the zlib library earlier than 1.1.3; 1.1.3 has a security vulnerability, so we recommend using 1.1.4 or later.