Slides

Build slides from the layouts a theme provides, and set the information a slide keeps about each object on it.

Slide

class creator_studio_doc_format.core.Slide(*, preset_identifier='', identifier=None, layout=None, contents=None, background=Override.not_set(), depth=None, note=None, **extra_data)[source]

A slide in a presentation.

field identifier : str | None = None

The slide’s identifier, which a link can use to point at the slide. Keynote writes a UUID string to this value; opening a presentation gives every slide a fresh identifier, so a value you supply for this identifier isn’t kept.

field layout : str | None = None

The slide layout of the slide. Keynote matches this value against each layout’s SlideLayout.identifier, then its SlideLayout.name. If nothing matches, it uses the theme’s first layout and reports a warning; if it’s absent, it uses the first layout.

field contents : list[SlideObject] | None = None

The objects on the slide, ordered back to front, with the first one farthest back. This list includes objects that belong to the slide’s layout, with SlideObject.source_kind set to layout, only when that layout sets SlideLayout.slide_objects_layer_with_layout; otherwise, this list doesn’t include those objects, and the slide draws them behind everything in this list.

field background : Override[SlideBackground] = Override.not_set()

Define the slide background as a color, gradient, or image, which overrides the default background inherited from the layout. A value of null removes the background entirely; if you omit the key, the slide retains the background associated with the specified layout.

field depth : int | None = None

The slide’s indentation level in the slide navigator, on a scale of 1 to 6. A slide indented deeper than the one before it becomes its child. Keynote clamps rather than rejects a depth more than 6 or more than one level below the preceding slide, and the first slide is always at the top level. The default indentation level is 1.

field note : Text | None = None

The slide’s presenter notes contains only text. Keynote removes inline objects with a warning, except for connection lines and non-table objects with an identifier, which prevent the document from loading. Image bullets whose image is missing and inline objects that aren’t importable also halt loading, in contrast to slides, where they merely remove the text box. A paragraph that lacks a Paragraph.style defaults to the theme’s Presenter Notes style, or the presentation’s custom style if previously overridden, and Keynote omits Paragraph.style for paragraphs that already use the presentation’s Presenter Notes style.

SlideBackground

class creator_studio_doc_format.core.SlideBackground(*, preset_identifier='', standard=None, **extra_data)[source]

The background of a slide.

field standard : Fill | None = None

A static color, gradient, or image fill. When Keynote exports a presentation, it writes a dynamic background as this case too: an image fill holding one still frame of it, or a color fill when that frame can’t be drawn.

SlideLayout

class creator_studio_doc_format.core.SlideLayout(*, preset_identifier='', identifier=None, name, contents=None, background=None, slide_objects_layer_with_layout=False, **extra_data)[source]

A slide layout in a Keynote theme.

It provides the default arrangement of placeholders, styles, and background for the slides that refer to it by identifier or name.

field identifier : str | None = None

The layout’s identifier, which Slide.layout is matched against before name. Keynote writes a UUID string here, but any string is accepted. Keep it unique within the theme, since two layouts sharing one can’t be told apart.

field name : str [Required]

The name of the layout as shown in Keynote’s layout list, such as Title & Subtitle. It’s matched by Slide.layout when no identifier matches. Keep it unique within the theme, since duplicate names can’t be differentiated.

field contents : list[SlideObject] | None = None

The objects on the layout, ordered back to front (the first one is farthest back).

field background : SlideBackground | None = None

The layout’s background. Slides based on this layout inherit it unless they specify their own background. A background that can’t be read (for example, a background image that is missing or isn’t a valid image) removes the whole layout, including everything on it, and a warning is reported; slides that would have used the layout are given a different one (see Slide.layout).

field slide_objects_layer_with_layout : bool = False

Whether slides using this layout let their own objects layer with the layout’s objects (true), or always show their objects in front of every layout object (false). When false, all layout objects are drawn behind all slide objects regardless of contents order.

SlideObject

class creator_studio_doc_format.core.SlideObject(*, preset_identifier='', instructional_text=None, is_locked=False, object, placeholder_info=None, source_kind=None, **extra_data)[source]

An object on a slide or slide layout, with slide-specific information about it.

field instructional_text : str | None = None

The placeholder text shown in the object while it’s empty, such as “Title Text” or “Double-click to edit.” It stops showing as soon as the object has content of its own.

field is_locked : bool = False

Whether the object is locked to prevent editing. It’s ignored when the document is read, so the object always opens unlocked.

field object : CanvasObject [Required]

The object itself, such as a shape, text box, image, movie, audio clip, table, chart, connection line, or group.

field placeholder_info : PlaceholderInfo | None = None

The placeholder the object acts as, predefined or tagged. Setting it marks the object as a placeholder. A tagged placeholder is always shown, and PlaceholderDefinition gives the restrictions on a predefined one. When several objects use the same predefined placeholder, only the first is kept and the rest are dropped from the slide without a warning.

field source_kind : SourceKind | None = None

The source of the object. If it’s absent, the object is treated as the slide’s own. For the layout kind, the object’s identifier is matched against the corresponding object in the layout the slide names; an identifier that matches nothing there creates a second, slide-owned copy alongside the layout’s object.

PlaceholderInfo

class creator_studio_doc_format.core.PlaceholderInfo(*, preset_identifier='', defined=None, tagged=None, **extra_data)[source]

The placeholder an object acts as on its slide.

It’s either one of the predefined placeholders that a layout can turn on and off, or a placeholder identified by a custom tag.

field defined : PlaceholderDefinition | None = None

One of the predefined placeholders that someone can turn on and off on any slide.

field tagged : str | None = None

A placeholder that has a tag associated with it. It can be an image, a movie, a shape, or a text box.

PlaceholderDefinition

class creator_studio_doc_format.core.PlaceholderDefinition(*, preset_identifier='', kind, is_visible=True, **extra_data)[source]

The predefined placeholder an object fills.

Only a shape or a text box is accepted, and one with is_visible set to false is still used as the placeholder, keeping its geometry, style, and text. An object of any other kind leaves the placeholder unfilled: it stays on the slide as ordinary content while is_visible is true, and is dropped altogether when it’s false.

field kind : SlideObjectPlaceholderInfoPlaceholderDefinitionKind [Required]

The predefined placeholder this object fills.

field is_visible : bool = True

Whether this placeholder is turned on for the slide. The default is true. When it’s false, the entry is still listed in Slide.contents, with its geometry and text, but isn’t shown.

SlideObjectPlaceholderInfoPlaceholderDefinitionKind

class creator_studio_doc_format.core.SlideObjectPlaceholderInfoPlaceholderDefinitionKind(str, Enum)[source]

The predefined placeholders that someone can turn on and off on any slide.

A field accepts a member or its value, so SlideObjectPlaceholderInfoPlaceholderDefinitionKind.BODY and 'body' are the same. The member’s name as a string isn’t accepted.

BODY = 'body'

The slide’s main body text.

OBJECT = 'object'

The object placeholder, a reserved area in which someone can place media or other content.

SLIDE_NUMBER = 'slide_number'

The slide number, which updates automatically.

TITLE = 'title'

The slide’s title text.

SourceKind

class creator_studio_doc_format.core.SourceKind(str, Enum)[source]

The source of an object.

layout means it appears on the slide because it belongs to the slide’s layout; placeholder means it appears because the corresponding layout placeholder was turned on; and user means someone added it to the slide directly.

A field accepts a member or its value, so SourceKind.LAYOUT and 'layout' are the same. The member’s name as a string isn’t accepted.

LAYOUT = 'layout'
PLACEHOLDER = 'placeholder'
USER = 'user'