CT_TextParagraph
paper-pptx 0.2.0 API reference
a:p custom element class
Attributes
br
attributebr= ZeroOrMore('a:br', successors=('a:endParaRPr',))content_children
attributecontent_childrentuple[CT_RegularTextRun | CT_TextLineBreak | CT_TextField, ...]Sequence containing text-container child elements of this a:p element.
These include a:r, a:br, and a:fld.
endParaRPr
attributeendParaRPrCT_TextCharacterProperties | None= ZeroOrOne('a:endParaRPr', successors=())get_or_add_endParaRPr
attributeget_or_add_endParaRPrCallable[[], CT_TextCharacterProperties]get_or_add_pPr
attributeget_or_add_pPrCallable[[], CT_TextParagraphProperties]pPr
attributepPrCT_TextParagraphProperties | None= ZeroOrOne('a:pPr', successors=('a:r', 'a:br', 'a:fld', 'a:endParaRPr'))r
attributer= ZeroOrMore('a:r', successors=('a:endParaRPr',))r_lst
attributer_lstlist[CT_RegularTextRun]text
attributetextstrstr text contained in this paragraph.
xml
attributexmlstrXML string for this element, suitable for testing purposes.
Pretty printed for readability and without an XML declaration at the top.
Functions
add_br
funcadd_br() -> CT_TextLineBreakReturn a newly appended a:br element.
Returns
pptx.oxml.text.CT_TextLineBreakadd_fld
funcadd_fld(id_str: str, field_type: str, cached_text: str) -> CT_TextFieldAppend an a:fld with id_str/field_type and cached a:t text (paper-pptx).
Content children (a:r/a:br/a:fld) precede a:endParaRPr per the schema; the
new field is inserted accordingly.
paramid_strstrparamfield_typestrparamcached_textstrReturns
pptx.oxml.text.CT_TextFieldadd_r
funcadd_r(text: str | None = None) -> CT_RegularTextRunReturn a newly appended a:r element.
paramtextstr | None= NoneReturns
pptx.oxml.text.CT_RegularTextRunappend_text
funcappend_text(text: str)Append a:r and a:br elements to p based on text.
Any or (vertical-tab) characters in text delimit a:r (run) elements and
themselves are translated to a:br (line-break) elements. The vertical-tab character
appears in clipboard text from PowerPoint at "soft" line-breaks (new-line, but not new
paragraph).
paramtextstrfirst_child_found_in
funcfirst_child_found_in(*tagnames: str) -> _Element | NoneFirst child with tag in tagnames, or None if not found.
paramtagnamesstr= ()Returns
lxml.etree._Element | Noneinsert_element_before
funcinsert_element_before(elm: ElementBase, *tagnames: str)paramelmElementBaseparamtagnamesstr= ()remove_all
funcremove_all(*tagnames: str) -> NoneRemove child elements with tagname (e.g. "a:p") in tagnames.
paramtagnamesstr= ()Returns
Nonexpath
funcxpath(xpath_str: str) -> AnyOverride of lxml _Element.xpath() method.
Provides standard Open XML namespace mapping (nsmap) in centralized location.
paramxpath_strstrReturns
typing.Any