NotesSlidePlaceholders
paper-pptx 0.2.0 API reference
Sequence of placeholder shapes on a notes slide.
Attributes
__iter__
attribute__iter__Callable[[], Iterator[NotesSlidePlaceholder]]element
attributeelementThe lxml element proxied by this object.
parent
attributeparentThe ancestor proxy object to this one.
For example, the parent of a shape is generally the SlideShapes object that contains it.
part
attributepartXmlPartThe package part containing this object.
turbo_add_enabled
attributeturbo_add_enabledboolTrue if "turbo-add" mode is enabled. Read/Write.
EXPERIMENTAL: This feature can radically improve performance when adding large numbers (hundreds of shapes) to a slide. It works by caching the last shape ID used and incrementing that value to assign the next shape id. This avoids repeatedly searching all shape ids in the slide each time a new ID is required.
Performance is not noticeably improved for a slide with a relatively small number of shapes, but because the search time rises with the square of the shape count, this option can be useful for optimizing generation of a slide composed of many shapes.
Shape-id collisions can occur (causing a repair error on load) if more than one Slide
object is used to interact with the same slide in the presentation. Note that the Slides
collection creates a new Slide object each time a slide is accessed (e.g. slide = prs.slides[0], so you must be careful to limit use to a single Slide object.
Functions
__getitem__
func__getitem__(idx: int) -> BaseShapeReturn shape at idx in sequence, e.g. shapes[2].
paramidxintReturns
pptx.shapes.base.BaseShape__len__
func__len__() -> intReturn count of shapes in this shape tree.
A group shape contributes 1 to the total, without regard to the number of shapes contained in the group.
Returns
intclone_placeholder
funcclone_placeholder(placeholder: LayoutPlaceholder) -> NoneAdd a new placeholder shape based on placeholder.
paramplaceholderLayoutPlaceholderReturns
Noneget
funcget(ph_type: PP_PLACEHOLDER, default: MasterPlaceholder | None = None)Return the first placeholder shape with type ph_type (e.g. 'body').
Returns default if no such placeholder shape is present in the collection.
paramph_typePP_PLACEHOLDERparamdefaultMasterPlaceholder | None= Noneph_basename
funcph_basename(ph_type: PP_PLACEHOLDER) -> strReturn the base name for a placeholder of ph_type in this shape collection.
There is some variance between slide types, for example a notes slide uses a different name for the body placeholder, so this method can be overriden by subclasses.
paramph_typePP_PLACEHOLDERReturns
str