pkgwriter
pkgwriter
¶
Provides low-level, write-only API to serialized (OPC) package.
OPC stands for Open Packaging Convention. This is e, essentially an implementation of OpcPackage.save().
PackageWriter
¶
Writes a zip-format OPC package to pkg_file, where pkg_file can be either a
path to a zip file (a string) or a file-like object.
Its single API method, write, is static, so this class is not intended to be instantiated.
write
staticmethod
¶
Write a physical package (.pptx file) to pkg_file containing pkg_rels and
parts and a content types stream based on the content types of the parts.
Source code in src/docx/opc/pkgwriter.py
_ContentTypesItem
¶
Service class that composes a content types item ([Content_Types].xml) based on a list of parts.
Not meant to be instantiated directly, its single interface method is xml_for(),
e.g. _ContentTypesItem.xml_for(parts).
Source code in src/docx/opc/pkgwriter.py
blob
property
¶
Return XML form of this content types item, suitable for storage as
[Content_Types].xml in an OPC package.
from_parts
classmethod
¶
Return content types XML mapping each part in parts to the appropriate
content type and suitable for storage as [Content_Types].xml in an OPC
package.