GNU Info

Info Node: (python2.1-lib.info)zipfile

(python2.1-lib.info)zipfile


Next: readline Prev: gzip Up: Optional Operating System Services
Enter node , (file) or (file)node

Work with ZIP archives
======================

Read and write ZIP-format archive files.  This module was written by
James C. Ahlstrom <jim@interet.com>.
This manual section was written by James C. Ahlstrom <jim@interet.com>.
_Added in Python version 1.6_

The ZIP file format is a common archive and compression standard.  This
module provides tools to create, read, write, append, and list a ZIP
file.  Any advanced use of this module will require an understanding of
the format, as defined in .

This module does not currently handle ZIP files which have appended
comments, or multi-disk ZIP files.

The available attributes of this module are:

`error'
     The error raised for bad ZIP files.

`ZipFile(...)'
     The class for reading and writing ZIP files.  See "" (section
     Note: ZipFile Objects) for constructor details.

`PyZipFile(...)'
     Class for creating ZIP archives containing Python libraries.

`ZipInfo([filename[, date_time]])'
     Class used the represent infomation about a member of an archive.
     Instances of this class are returned by the `getinfo()' and
     `infolist()' methods of `ZipFile' objects.  Most users of the
     `zipfile' module will not need to create these, but only use those
     created by this module.  FILENAME should be the full name of the
     archive member, and DATE_TIME should be a tuple containing six
     fields which describe the time of the last modification to the
     file; the fields are described in section Note: readline,
     "ZipInfo Objects."

`is_zipfile(filename)'
     Returns true if FILENAME is a valid ZIP file based on its magic
     number, otherwise returns false.  This module does not currently
     handle ZIP files which have appended comments.

`ZIP_STORED'
     The numeric constant for an uncompressed archive member.

`ZIP_DEFLATED'
     The numeric constant for the usual ZIP compression method.  This
     requires the zlib module.  No other compression methods are
     currently supported.

See also:
     `PKZIP Application Note'{Documentation on the ZIP file format by
     Phil Katz, the creator of the format and algorithms used.}

     `Info-ZIP Home Page'{ Information about the Info-ZIP project's ZIP
     archive programs and development libraries.}

ZipFile Objects
PyZipFile Objects
ZipInfo Objects

automatically generated by info2www version 1.2.2.9