MCPcopy Index your code
hub / github.com/python-openxml/python-docx / part_related_by

Method part_related_by

src/docx/opc/package.py:131–137  ·  view source on GitHub ↗

Return part to which this package has a relationship of `reltype`. Raises |KeyError| if no such relationship is found and |ValueError| if more than one such relationship is found.

(self, reltype: str)

Source from the content-addressed store, hash-verified

129 return package
130
131 def part_related_by(self, reltype: str) -> Part:
132 """Return part to which this package has a relationship of `reltype`.
133
134 Raises |KeyError| if no such relationship is found and |ValueError| if more than
135 one such relationship is found.
136 """
137 return self.rels.part_with_reltype(reltype)
138
139 @property
140 def parts(self) -> list[Part]:

Callers 2

main_document_partMethod · 0.95
_core_properties_partMethod · 0.95

Calls 1

part_with_reltypeMethod · 0.80

Tested by

no test coverage detected