_Relationship
paper-pptx 0.2.0 API reference
Value object describing link from a part or package to another part.
_Relationship(base_uri: str, rId: str, reltype: str, target_mode: str, target: Part | str)Attributes
is_external
attributeis_externalboolTrue if target_mode is RTM.EXTERNAL.
An external relationship is a link to a resource outside the package, such as a web-resource (URL).
rId
attributerIdstrstr relationship-id, like 'rId9'.
Corresponds to the Id attribute on the CT_Relationship element and uniquely identifies
this relationship within its peers for the source-part or package.
reltype
attributereltypestrMember of RELATIONSHIP_TYPE describing relationship of target to source.
target_part
attributetarget_partPartPart or subtype referred to by this relationship.
target_partname
attributetarget_partnamePackURIPackURI instance containing partname targeted by this relationship.
Raises ValueError on reference if target_mode is external. Use :attr:target_mode to
check before referencing.
target_ref
attributetarget_refstrstr reference to relationship target.
For internal relationships this is the relative partname, suitable for serialization purposes. For an external relationship it is typically a URL.
Functions
from_xml
funcfrom_xml(base_uri: str, rel: CT_Relationship, parts: dict[PackURI, Part]) -> _RelationshipReturn _Relationship object based on CT_Relationship element rel.
parambase_uristrparamrelCT_Relationshipparampartsdict[PackURI, Part]Returns
pptx.opc.package._Relationship