zip – OfficeDissector - Zip Class

An interface to the OOXML Document as a Zip file, and a lightweight wrapper around Zipfile.

class officedissector.zip.Zip(filepath)

An interface to the OOXML Document as a Zip file, and a lightweight wrapper around the ZipFile module.

Variables:
  • filepath – Path to the Zip (OOXML) file.
  • zippartsinfo – A list containing a ZipInfo object for each member of the Zip file. The ZipInfo object contains all information about the member of the Zip file.
  • comment – The comment text associated with the Zip file.
__init__(filepath)

Initialize zip attributes.

Parameters:filepath (string) – the path to the OOXML Document
namelist()

Get list of files in Zip archive.

Returns:list of names of files in the Zip archive
part_extract(partname)

Extract part from the Zip archive.

Parameters:partname (string) – name of the Part (member of the Zip archive) to extract
Returns:file-like object of the member of the Zip archive.
part_info(partname)

Get ZipInfo object for Part.

Parameters:partname (string) – name of Part (member of the Zip archive)
Returns:ZipInfo
testzip()

Test zip CRC value.

Raises ZipCRCError:
 If the Zip CRC is incorrect

Previous topic

rel – OfficeDissector - Relationship Class

Next topic

features – OfficeDissector - Features Class

This Page