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.
zlib— Compression compatible with gzipgzip— Support for gzip filesbz2— Support for bzip2 compressionlzma— Compression using the LZMA algorithmzipfile— Work with ZIP archivesBadZipFileBadZipfileLargeZipFileZipInfois_zipfile()ZIP_STOREDZIP_DEFLATEDZIP_BZIP2ZIP_LZMA- ZipFile Objects
- Path Objects
- PyZipFile Objects
- 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
- Command-Line Interface
- Decompression pitfalls
tarfile— Read and write tar archive filesopen()is_tarfile()TarErrorReadErrorCompressionErrorStreamErrorExtractErrorHeaderErrorFilterErrorAbsolutePathErrorOutsideDestinationErrorSpecialFileErrorAbsoluteLinkErrorLinkOutsideDestinationErrorENCODINGUSTAR_FORMATGNU_FORMATPAX_FORMATDEFAULT_FORMAT- TarFile Objects
- 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()
- Extraction filters
- Command-Line Interface
- Examples
- Supported tar formats
- Unicode issues