package
package
¶
WordprocessingML Package class and related objects.
Package
¶
Bases: OpcPackage
Customizations specific to a WordprocessingML package.
after_unmarshal
¶
Called by loading code after all parts and relationships have been loaded.
This method affords the opportunity for any required post-processing.
get_or_add_image_part
¶
get_or_add_image_part(
image_descriptor: str | PathLike[str] | IO[bytes],
) -> ImagePart
Return ImagePart containing image specified by image_descriptor.
The image-part is newly created if a matching one is not already present in the collection.
Source code in src/docx/package.py
ImageParts
¶
Collection of ImagePart objects corresponding to images in the package.
get_or_add_image_part
¶
get_or_add_image_part(
image_descriptor: str | PathLike[str] | IO[bytes],
) -> ImagePart
Return ImagePart object containing image identified by image_descriptor.
The image-part is newly created if a matching one is not present in the collection.