CorePropertiesPart
paper-pptx 0.2.0 API reference
Corresponds to part named /docProps/core.xml.
Contains the core document properties for this document package.
Attributes
author
attributeauthorstrblob
attributeblobbytesbytes XML serialization of this part.
category
attributecategorystrcomments
attributecommentsstrcontent_status
attributecontent_statusstrcontent_type
attributecontent_typestrContent-type (MIME-type) of this part.
created
attributecreatedidentifier
attributeidentifierstrkeywords
attributekeywordsstrlanguage
attributelanguagestrlast_modified_by
attributelast_modified_bystrlast_printed
attributelast_printedmodified
attributemodifiedpackage
attributepackagePackagePackage this part belongs to.
part
attributepartThis part.
This is part of the parent protocol, "children" of the document will not know the part that contains them so must ask their parent object. That chain of delegation ends here for child objects.
partname
attributepartnamePackURIPackURI partname for this part, e.g. "/ppt/slides/slide1.xml".
rels
attributerels_RelationshipsCollection of relationships from this part to other parts.
revision
attributerevisionsubject
attributesubjectstrtitle
attributetitlestrversion
attributeversionstrFunctions
default
funcdefault(package: Package)Return default new CorePropertiesPart instance suitable as starting point.
This provides a base for adding core-properties to a package that doesn't yet have any.
parampackagePackagedrop_rel
funcdrop_rel(rId: str) -> NoneRemove relationship identified by rId if its reference count is under 2.
Relationships with a reference count of 0 are implicit relationships. Note that only XML parts can drop relationships.
paramrIdstrReturns
Noneload
funcload(partname: PackURI, content_type: str, package: Package, blob: bytes)Return instance of cls loaded with parsed XML from blob.
parampartnamePackURIparamcontent_typestrparampackagePackageparamblobbytesload_rels_from_xml
funcload_rels_from_xml(xml_rels: CT_Relationships, parts: dict[PackURI, Part]) -> Noneload _Relationships for this part from xml_rels.
Part references are resolved using the parts dict that maps each partname to the loaded
part with that partname. These relationships are loaded from a serialized package and so
already have assigned rIds. This method is only used during package loading.
paramxml_relsCT_Relationshipsparampartsdict[PackURI, Part]Returns
Nonepart_related_by
funcpart_related_by(reltype: str) -> PartReturn (single) part having relationship to this package of reltype.
Raises KeyError if no such relationship is found and ValueError if more than one such
relationship is found.
paramreltypestrReturns
pptx.opc.package.Partrelate_to
funcrelate_to(target: Part | str, reltype: str, is_external: bool = False) -> strReturn rId key of relationship of reltype to target.
If such a relationship already exists, its rId is returned. Otherwise the relationship is added and its new rId returned.
paramtargetPart | strparamreltypestrparamis_externalbool= FalseReturns
strrelated_part
funcrelated_part(rId: str) -> PartReturn related Part subtype identified by rId.
paramrIdstrReturns
pptx.opc.package.Parttarget_ref
functarget_ref(rId: str) -> strReturn URL contained in target ref of relationship identified by rId.
paramrIdstrReturns
str