MCPcopy Create free account
hub / github.com/scanny/python-pptx / Presentation

Class Presentation

src/pptx/presentation.py:18–113  ·  view source on GitHub ↗

PresentationML (PML) presentation. Not intended to be constructed directly. Use :func:`pptx.Presentation` to open or create a presentation.

Source from the content-addressed store, hash-verified

16
17
18class Presentation(PartElementProxy):
19 """PresentationML (PML) presentation.
20
21 Not intended to be constructed directly. Use :func:`pptx.Presentation` to open or
22 create a presentation.
23 """
24
25 _element: CT_Presentation
26 part: PresentationPart # pyright: ignore[reportIncompatibleMethodOverride]
27
28 @property
29 def core_properties(self):
30 """|CoreProperties| instance for this presentation.
31
32 Provides read/write access to the Dublin Core document properties for the presentation.
33 """
34 return self.part.core_properties
35
36 @property
37 def notes_master(self) -> NotesMaster:
38 """Instance of |NotesMaster| for this presentation.
39
40 If the presentation does not have a notes master, one is created from a default template
41 and returned. The same single instance is returned on each call.
42 """
43 return self.part.notes_master
44
45 def save(self, file: str | IO[bytes]):
46 """Writes this presentation to `file`.
47
48 `file` can be either a file-path or a file-like object open for writing bytes.
49 """
50 self.part.save(file)
51
52 @property
53 def slide_height(self) -> Length | None:
54 """Height of slides in this presentation, in English Metric Units (EMU).
55
56 Returns |None| if no slide width is defined. Read/write.
57 """
58 sldSz = self._element.sldSz
59 if sldSz is None:
60 return None
61 return sldSz.cy
62
63 @slide_height.setter
64 def slide_height(self, height: Length):
65 sldSz = self._element.get_or_add_sldSz()
66 sldSz.cy = height
67
68 @property
69 def slide_layouts(self) -> SlideLayouts:
70 """|SlideLayouts| collection belonging to the first |SlideMaster| of this presentation.
71
72 A presentation can have more than one slide master and each master will have its own set
73 of layouts. This property is a convenience for the common case where the presentation has
74 only a single slide master.
75 """

Callers 13

presentationMethod · 0.90
core_props_fixtureMethod · 0.90
layouts_fixtureMethod · 0.90
master_fixtureMethod · 0.90
masters_fixtureMethod · 0.90
notes_master_fixtureMethod · 0.90
part_fixtureMethod · 0.90
save_fixtureMethod · 0.90
sld_width_get_fixtureMethod · 0.90
sld_width_set_fixtureMethod · 0.90

Calls

no outgoing calls

Tested by 12

core_props_fixtureMethod · 0.72
layouts_fixtureMethod · 0.72
master_fixtureMethod · 0.72
masters_fixtureMethod · 0.72
notes_master_fixtureMethod · 0.72
part_fixtureMethod · 0.72
save_fixtureMethod · 0.72
sld_width_get_fixtureMethod · 0.72
sld_width_set_fixtureMethod · 0.72
slides_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…