MCPcopy Create free account
hub / github.com/scanny/python-pptx / parse_from_template

Function parse_from_template

src/pptx/oxml/__init__.py:25–31  ·  view source on GitHub ↗

Return an element loaded from the XML in the template file identified by `template_name`.

(template_file_name: str)

Source from the content-addressed store, hash-verified

23
24
25def parse_from_template(template_file_name: str):
26 """Return an element loaded from the XML in the template file identified by `template_name`."""
27 thisdir = os.path.split(__file__)[0]
28 filename = os.path.join(thisdir, "..", "templates", "%s.xml" % template_file_name)
29 with open(filename, "rb") as f:
30 xml = f.read()
31 return parse_xml(xml)
32
33
34def parse_xml(xml: str | bytes):

Callers 3

new_defaultMethod · 0.90
newMethod · 0.90
new_defaultMethod · 0.85

Calls 3

parse_xmlFunction · 0.85
splitMethod · 0.80
readMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…