Paper Office
paper-docxAPI referenceopc.phys_pkg

GuardedZipReader

paper-docx 0.2.0 API reference

Validate and stream every member of an already-open ZipFile.

Construction fully validates the archive and caches member bytes. This makes ordinary Document() opens and package-kernel reads share the same validation, including for members not reachable from OPC relationships.

GuardedZipReader(zip_file: ZipFile)

Attributes

order

attributeorderTuple[str, ...]

Member names in central-directory order.

Functions

read

funcread(name: str) -> bytes

Return validated bytes for member name.

paramnamestr

Returns

bytes

read_all

funcread_all() -> Tuple[Dict[str, bytes], List[str]]

Return a copy of validated parts and their archive order.

Returns

typing.Tuple[typing.Dict[str, bytes], typing.List[str]]

On this page