MCPcopy Create free account
hub / github.com/python-openxml/python-docx / get_style

Method get_style

src/docx/parts/story.py:41–47  ·  view source on GitHub ↗

Return the style in this document matching `style_id`. Returns the default style for `style_type` if `style_id` is |None| or does not match a defined style of `style_type`.

(self, style_id: str | None, style_type: WD_STYLE_TYPE)

Source from the content-addressed store, hash-verified

39 return rId, image_part.image
40
41 def get_style(self, style_id: str | None, style_type: WD_STYLE_TYPE) -> BaseStyle:
42 """Return the style in this document matching `style_id`.
43
44 Returns the default style for `style_type` if `style_id` is |None| or does not
45 match a defined style of `style_type`.
46 """
47 return self._document_part.get_style(style_id, style_type)
48
49 def get_style_id(
50 self, style_or_name: BaseStyle | str | None, style_type: WD_STYLE_TYPE

Callers 4

styleMethod · 0.45
styleMethod · 0.45
styleMethod · 0.45

Calls

no outgoing calls

Tested by 1