zipfile.ZipFile.getinfo()

ZipFile.getinfo(name) Return a ZipInfo object with information about the archive member name. Calling getinfo() for a name not currently contained in the archive will raise a KeyError.

zipfile.ZipFile.extractall()

ZipFile.extractall(path=None, members=None, pwd=None) Extract all members from the archive to the current working directory. path specifies a different directory to extract to. members is optional and must be a subset of the list returned by namelist(). pwd is the password used for encrypted files. Warning Never extract archives from untrusted sources without prior inspection. It is possible that files are created outside of path, e.g. members that have absolute filenames starting with "/"

zipfile.ZipFile.extract()

ZipFile.extract(member, path=None, pwd=None) Extract a member from the archive to the current working directory; member must be its full name or a ZipInfo object. Its file information is extracted as accurately as possible. path specifies a different directory to extract to. member can be a filename or a ZipInfo object. pwd is the password used for encrypted files. Returns the normalized path created (a directory or new file). Note If a member filename is an absolute path, a drive/UNC share

zipfile.ZipFile.debug

ZipFile.debug The level of debug output to use. This may be set from 0 (the default, no output) to 3 (the most output). Debugging information is written to sys.stdout.

zipfile.ZipFile.comment

ZipFile.comment The comment text associated with the ZIP file. If assigning a comment to a ZipFile instance created with mode 'w', 'x' or 'a', this should be a string no longer than 65535 bytes. Comments longer than this will be truncated in the written archive when close() is called.

zipfile.ZipFile.close()

ZipFile.close() Close the archive file. You must call close() before exiting your program or essential records will not be written.

zipfile.ZipFile

class zipfile.ZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=True) Open a ZIP file, where file can be either a path to a file (a string) or a file-like object. The mode parameter should be 'r' to read an existing file, 'w' to truncate and write a new file, 'a' to append to an existing file, or 'x' to exclusively create and write a new file. If mode is 'x' and file refers to an existing file, a FileExistsError will be raised. If mode is 'a' and file refers to an existing ZIP file,

zipfile.PyZipFile.writepy()

writepy(pathname, basename='', filterfunc=None) Search for files *.py and add the corresponding file to the archive. If the optimize parameter to PyZipFile was not given or -1, the corresponding file is a *.pyc file, compiling if necessary. If the optimize parameter to PyZipFile was 0, 1 or 2, only files with that optimization level (see compile()) are added to the archive, compiling if necessary. If pathname is a file, the filename must end with .py, and just the (corresponding *.py[co]) fi

zipfile.PyZipFile

class zipfile.PyZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=True, optimize=-1) New in version 3.2: The optimize parameter. Changed in version 3.4: ZIP64 extensions are enabled by default. Instances have one method in addition to those of ZipFile objects: writepy(pathname, basename='', filterfunc=None) Search for files *.py and add the corresponding file to the archive. If the optimize parameter to PyZipFile was not given or -1, the corresponding file is a *.pyc file, co

zipfile.LargeZipFile

exception zipfile.LargeZipFile The error raised when a ZIP file would require ZIP64 functionality but that has not been enabled.