Paper Office
paper-pptxAPI referenceoxml.slide

CT_Slide

paper-pptx 0.2.0 API reference

p:sld element, root element of a slide part (XML document).

Attributes

bg

attributebg

Return p:bg grandchild or None if not present.

cSld

attributecSldCT_CommonSlideData
= OneAndOnlyOne('p:cSld')

clrMapOvr

attributeclrMapOvr
= ZeroOrOne('p:clrMapOvr', successors=(_tag_seq[2:]))

spTree

attributespTreeCT_GroupShape

Return required p:cSld/p:spTree grandchild.

timing

attributetiming
= ZeroOrOne('p:timing', successors=(_tag_seq[4:]))

xml

attributexmlstr

XML string for this element, suitable for testing purposes.

Pretty printed for readability and without an XML declaration at the top.

Functions

first_child_found_in

funcfirst_child_found_in(*tagnames: str) -> _Element | None

First child with tag in tagnames, or None if not found.

paramtagnamesstr
= ()

Returns

lxml.etree._Element | None

get_or_add_childTnLst

funcget_or_add_childTnLst()

Return parent element for a new p:video child element.

The p:video element causes play controls to appear under a video shape (pic shape containing video). There can be more than one video shape on a slide, which causes the precondition to vary. It needs to handle the case when there is no p:sld/p:timing element and when that element already exists. If the case isn't simple, it just nukes what's there and adds a fresh one. This could theoretically remove desired existing timing information, but there isn't any evidence available to me one way or the other, so I've taken the simple approach.

insert_element_before

funcinsert_element_before(elm: ElementBase, *tagnames: str)
paramelmElementBase
paramtagnamesstr
= ()

new

funcnew() -> CT_Slide

Return new p:sld element configured as base slide shape.

Returns

pptx.oxml.slide.CT_Slide

remove_all

funcremove_all(*tagnames: str) -> None

Remove child elements with tagname (e.g. "a:p") in tagnames.

paramtagnamesstr
= ()

Returns

None

xpath

funcxpath(xpath_str: str) -> Any

Override of lxml _Element.xpath() method.

Provides standard Open XML namespace mapping (nsmap) in centralized location.

paramxpath_strstr

Returns

typing.Any

On this page