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

Method _core_properties_part

src/docx/opc/package.py:169–179  ·  view source on GitHub ↗

|CorePropertiesPart| object related to this package. Creates a default core properties part if one is not present (not common).

(self)

Source from the content-addressed store, hash-verified

167
168 @property
169 def _core_properties_part(self) -> CorePropertiesPart:
170 """|CorePropertiesPart| object related to this package.
171
172 Creates a default core properties part if one is not present (not common).
173 """
174 try:
175 return cast(CorePropertiesPart, self.part_related_by(RT.CORE_PROPERTIES))
176 except KeyError:
177 core_properties_part = CorePropertiesPart.default(self)
178 self.relate_to(core_properties_part, RT.CORE_PROPERTIES)
179 return core_properties_part
180
181
182class Unmarshaller:

Callers

nothing calls this directly

Calls 3

part_related_byMethod · 0.95
relate_toMethod · 0.95
defaultMethod · 0.45

Tested by

no test coverage detected