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 archivesBadZipFile
BadZipfile
LargeZipFile
ZipInfo
is_zipfile()
ZIP_STORED
ZIP_DEFLATED
ZIP_BZIP2
ZIP_LZMA
- ZipFile Objects
- Path Objects
- PyZipFile Objects
- ZipInfo Objects
ZipInfo.from_file()
ZipInfo.is_dir()
ZipInfo.filename
ZipInfo.date_time
ZipInfo.compress_type
ZipInfo.comment
ZipInfo.extra
ZipInfo.create_system
ZipInfo.create_version
ZipInfo.extract_version
ZipInfo.reserved
ZipInfo.flag_bits
ZipInfo.volume
ZipInfo.internal_attr
ZipInfo.external_attr
ZipInfo.header_offset
ZipInfo.CRC
ZipInfo.compress_size
ZipInfo.file_size
- Command-Line Interface
- Decompression pitfalls
tarfile
— Read and write tar archive filesopen()
is_tarfile()
TarError
ReadError
CompressionError
StreamError
ExtractError
HeaderError
ENCODING
USTAR_FORMAT
GNU_FORMAT
PAX_FORMAT
DEFAULT_FORMAT
- TarFile Objects
- TarInfo Objects
TarInfo
TarInfo.frombuf()
TarInfo.fromtarfile()
TarInfo.tobuf()
TarInfo.name
TarInfo.size
TarInfo.mtime
TarInfo.mode
TarInfo.type
TarInfo.linkname
TarInfo.uid
TarInfo.gid
TarInfo.uname
TarInfo.gname
TarInfo.pax_headers
TarInfo.isfile()
TarInfo.isreg()
TarInfo.isdir()
TarInfo.issym()
TarInfo.islnk()
TarInfo.ischr()
TarInfo.isblk()
TarInfo.isfifo()
TarInfo.isdev()
- Command-Line Interface
- Examples
- Supported tar formats
- Unicode issues