Paper Office
paper-pptxAPI referenceoxml

pptx.oxml

paper-pptx 0.2.0 API reference

Initializes lxml parser, particularly the custom element classes.

Also makes available a handful of functions that wrap its typical uses.

element_class_lookup

attributeelement_class_lookup
= etree.ElementNamespaceClassLookup()

oxml_parser

attributeoxml_parser
= etree.XMLParser(remove_blank_text=True, resolve_entities=False)

parse_from_template

funcparse_from_template(template_file_name: str)

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

paramtemplate_file_namestr

parse_xml

funcparse_xml(xml: str | bytes)

Return root lxml element obtained by parsing XML character string in xml.

paramxmlstr | bytes

register_element_cls

funcregister_element_cls(nsptagname: str, cls: Type[BaseOxmlElement])

Register cls to be constructed when oxml parser encounters element having nsptag_name.

nsptag_name is a string of the form nspfx:tagroot, e.g. "w:document".

paramnsptagnamestr

On this page