Paper Office
paper-pptxAPI referenceslide

SlideLayouts

paper-pptx 0.2.0 API reference

Sequence of slide layouts belonging to a slide-master.

Supports indexed access, len(), iteration, index() and remove().

SlideLayouts(sldLayoutIdLst: CT_SlideLayoutIdList, parent: SlideMaster)

Attributes

element

attributeelement

The lxml element proxied by this object.

parent

attributeparent

The ancestor proxy object to this one.

For example, the parent of a shape is generally the SlideShapes object that contains it.

part

attributepartSlideMasterPart

Functions

__getitem__

func__getitem__(idx: int) -> SlideLayout

Provides indexed access, e.g. slide_layouts[2].

paramidxint

Returns

pptx.slide.SlideLayout

__iter__

func__iter__() -> Iterator[SlideLayout]

Generate each SlideLayout in the collection, in sequence.

Returns

typing.Iterator[pptx.slide.SlideLayout]

__len__

func__len__() -> int

Support len() built-in function, e.g. len(slides) == 4.

Returns

int

get_by_name

funcget_by_name(name: str, default: SlideLayout | None = None) -> SlideLayout | None

Return SlideLayout object having name, or default if not found.

paramnamestr
paramdefaultSlideLayout | None
= None

Returns

pptx.slide.SlideLayout | None

index

funcindex(slide_layout: SlideLayout) -> int

Return zero-based index of slide_layout in this collection.

Raises ValueError if slide_layout is not present in this collection.

paramslide_layoutSlideLayout

Returns

int

remove

funcremove(slide_layout: SlideLayout) -> None

Remove slide_layout from the collection.

Raises ValueError when slide_layout is in use; a slide layout which is the basis for one or more slides cannot be removed.

Refuses with TargetNotFoundError when the layout belongs to another presentation, and with UnsupportedStructureError when its part carries inbound relationships beyond this collection's own, where dropping it would strand whatever else points at it.

paramslide_layoutSlideLayout

Returns

None

On this page