Paper Office
paper-pptxAPI referenceinspect

TextBlock

paper-pptx 0.2.0 API reference

One paragraph of one text body, with anchor and per-run effective fonts.

container says where the text lives: "shape" (a top-level p:sp), "group" (a p:sp inside p:grpSp nesting; container_detail is the slash-joined group-name path), or "table-cell" (container_detail is "<frame-name>!r{row}c{col}"). blind is True when the block's text is visible but its effective values are unresolvable by design in this version (table-cell runs inherit through table styles, a chain not yet walked); a blind block's runs carry resolved=False values, never guesses.

TextBlock(anchor: BlockAnchor, shape_id: int, shape_name: str, placeholder_type: Optional[str], level: int, text: str, runs: Tuple[InspectedRun, ...], container: str = 'shape', container_detail: Optional[str] = None, blind: bool = False, fields: Tuple[str, ...] = ())

Attributes

anchor

attributeanchorBlockAnchor

blind

attributeblindbool
= False

container

attributecontainerstr
= 'shape'

container_detail

attributecontainer_detailOptional[str]
= None

fields

attributefieldsTuple[str, ...]
= ()

level

attributelevelint

placeholder_type

attributeplaceholder_typeOptional[str]

runs

attributerunsTuple[InspectedRun, ...]

shape_id

attributeshape_idint

shape_name

attributeshape_namestr

text

attributetextstr

Functions

to_dict

functo_dict() -> dict

Return this block as a JSON-ready dict, anchor included, for reports and diffs.

Returns

dict

On this page