phys_pkg
phys_pkg
¶
Provides a general interface to a physical OPC package, such as a zip file.
PhysPkgReader
¶
Factory for physical package reader objects.
PhysPkgWriter
¶
Factory for physical package writer objects.
_DirPkgReader
¶
Bases: PhysPkgReader
Implements PhysPkgReader interface for an OPC package extracted into a directory.
path is the path to a directory containing an expanded package.
Source code in src/docx/opc/phys_pkg.py
content_types_xml
property
¶
Return the [Content_Types].xml blob from the package.
blob_for
¶
Return contents of file corresponding to pack_uri in package directory.
contains
¶
close
¶
Provides interface consistency with ZipFileSystem, but does nothing, a
directory file system doesn't need closing.
rels_xml_for
¶
Return rels item XML for source with source_uri, or None if the item has no
rels item.
Source code in src/docx/opc/phys_pkg.py
_ZipPkgReader
¶
Bases: PhysPkgReader
Implements PhysPkgReader interface for a zip file OPC package.
Source code in src/docx/opc/phys_pkg.py
content_types_xml
property
¶
Return the [Content_Types].xml blob from the zip package.
blob_for
¶
Return blob corresponding to pack_uri.
Raises ValueError if no matching member is present in zip archive.
close
¶
contains
¶
rels_xml_for
¶
Return rels item XML for source with source_uri or None if no rels item is
present.
_ZipPkgWriter
¶
Bases: PhysPkgWriter
Implements PhysPkgWriter interface for a zip file OPC package.
Source code in src/docx/opc/phys_pkg.py
close
¶
write
¶
Write blob to this zip package with the membername corresponding to
pack_uri.