13. Data Compression and Archiving¶
The modules described in this chapter support data compression with the zlib,
gzip, bzip2 and lzma algorithms, and the creation of ZIP- and tar-format
archives. See also Archiving operations provided by the shutil
module.
- 13.1.
zlib— Compression compatible with gzip - 13.2.
gzip— Support for gzip files - 13.3.
bz2— Support for bzip2 compression - 13.4.
lzma— Compression using the LZMA algorithm - 13.5.
zipfile— Work with ZIP archivesBadZipFileBadZipfileLargeZipFileZipInfois_zipfile()ZIP_STOREDZIP_DEFLATEDZIP_BZIP2ZIP_LZMA- 13.5.1. ZipFile Objects
- 13.5.2. PyZipFile Objects
- 13.5.3. ZipInfo Objects
ZipInfo.from_file()ZipInfo.is_dir()ZipInfo.filenameZipInfo.date_timeZipInfo.compress_typeZipInfo.commentZipInfo.extraZipInfo.create_systemZipInfo.create_versionZipInfo.extract_versionZipInfo.reservedZipInfo.flag_bitsZipInfo.volumeZipInfo.internal_attrZipInfo.external_attrZipInfo.header_offsetZipInfo.CRCZipInfo.compress_sizeZipInfo.file_size
- 13.5.4. Command-Line Interface
- 13.5.5. Decompression pitfalls
- 13.6.
tarfile— Read and write tar archive filesopen()TarFileis_tarfile()TarErrorReadErrorCompressionErrorStreamErrorExtractErrorHeaderErrorENCODINGUSTAR_FORMATGNU_FORMATPAX_FORMATDEFAULT_FORMAT- 13.6.1. TarFile Objects
- 13.6.2. TarInfo Objects
TarInfoTarInfo.frombuf()TarInfo.fromtarfile()TarInfo.tobuf()TarInfo.nameTarInfo.sizeTarInfo.mtimeTarInfo.modeTarInfo.typeTarInfo.linknameTarInfo.uidTarInfo.gidTarInfo.unameTarInfo.gnameTarInfo.pax_headersTarInfo.isfile()TarInfo.isreg()TarInfo.isdir()TarInfo.issym()TarInfo.islnk()TarInfo.ischr()TarInfo.isblk()TarInfo.isfifo()TarInfo.isdev()
- 13.6.3. Command-Line Interface
- 13.6.4. Examples
- 13.6.5. Supported tar formats
- 13.6.6. Unicode issues
