Presentation
PresentationML (PML) presentation. Not intended to be constructed directly. Usepptx.Presentation() to open or create a presentation.
Properties
core_properties
CoreProperties - Read/write access to the Dublin Core document properties for the presentation.
Provides access to metadata like author, title, subject, keywords, etc.
notes_master
NotesMaster - Instance of notes master for this presentation.
If the presentation does not have a notes master, one is created from a default template and returned. The same single instance is returned on each call.
slide_height
Length | None - Height of slides in this presentation, in English Metric Units (EMU). Read/write.
Returns None if no slide height is defined.
slide_layouts
SlideLayouts - Collection of slide layouts belonging to the first slide master.
A presentation can have more than one slide master and each master will have its own set of layouts. This property is a convenience for the common case where the presentation has only a single slide master.
slide_master
SlideMaster - First slide master belonging to this presentation.
Typically, presentations have only a single slide master. This property provides simpler access in that common case.
slide_masters
SlideMasters - Collection of slide masters belonging to this presentation.
slide_width
Length | None - Width of slides in this presentation, in English Metric Units (EMU). Read/write.
Returns None if no slide width is defined.
slides
Slides - Collection of slides in this presentation.
Methods
save()
Writes this presentation to a file.File path (string) or file-like object open for writing bytes
CoreProperties
Provides read/write access to the Dublin Core document properties for a presentation. Accessed via thecore_properties attribute of a Presentation object.
Properties
author
str - An entity primarily responsible for making the content of the resource.
category
str - A categorization of the content of this package. Example values: Resume, Letter, Financial Forecast, Proposal, Technical Presentation.
comments
str - An account of the content of the resource.
content_status
str - Completion status of the document, e.g. ‘draft’.
created
datetime | None - Time of initial creation of the document. Date properties return None if not set.
identifier
str - An unambiguous reference to the resource within a given context, e.g. ISBN.
keywords
str - Descriptive words or short phrases likely to be used as search terms for this document.
language
str - Language the document is written in.
last_modified_by
str - Name or other identifier (such as email address) of person who last modified the document.
last_printed
datetime | None - Time the document was last printed.
modified
datetime | None - Time the document was last modified.
revision
int - Number of this revision, incremented by PowerPoint each time the document is saved. Note that the revision number is not automatically incremented by python-pptx.
subject
str - The topic of the content of the resource.
title
str - The name given to the resource.
version
str - Free-form version string.
Notes
- String properties are limited in length to 255 characters and return an empty string (
'') if not set. - Date properties are assigned and returned as
datetimeobjects without timezone (UTC). - Date properties return
Noneif not set. - python-pptx does not automatically set any core properties except when adding a core properties part to a presentation that doesn’t have one.