ps-python-pptx 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. pptx/__init__.py +84 -0
  2. pptx/action.py +270 -0
  3. pptx/api.py +49 -0
  4. pptx/chart/__init__.py +0 -0
  5. pptx/chart/axis.py +523 -0
  6. pptx/chart/category.py +200 -0
  7. pptx/chart/chart.py +280 -0
  8. pptx/chart/data.py +864 -0
  9. pptx/chart/datalabel.py +288 -0
  10. pptx/chart/legend.py +79 -0
  11. pptx/chart/marker.py +70 -0
  12. pptx/chart/plot.py +412 -0
  13. pptx/chart/point.py +101 -0
  14. pptx/chart/series.py +258 -0
  15. pptx/chart/xlsx.py +272 -0
  16. pptx/chart/xmlwriter.py +1840 -0
  17. pptx/dml/__init__.py +0 -0
  18. pptx/dml/chtfmt.py +40 -0
  19. pptx/dml/color.py +301 -0
  20. pptx/dml/effect.py +41 -0
  21. pptx/dml/fill.py +468 -0
  22. pptx/dml/line.py +100 -0
  23. pptx/enum/__init__.py +0 -0
  24. pptx/enum/action.py +71 -0
  25. pptx/enum/base.py +175 -0
  26. pptx/enum/chart.py +492 -0
  27. pptx/enum/dml.py +405 -0
  28. pptx/enum/lang.py +685 -0
  29. pptx/enum/shapes.py +1029 -0
  30. pptx/enum/text.py +371 -0
  31. pptx/exc.py +23 -0
  32. pptx/media.py +197 -0
  33. pptx/opc/__init__.py +0 -0
  34. pptx/opc/constants.py +331 -0
  35. pptx/opc/oxml.py +188 -0
  36. pptx/opc/package.py +762 -0
  37. pptx/opc/packuri.py +109 -0
  38. pptx/opc/serialized.py +296 -0
  39. pptx/opc/shared.py +20 -0
  40. pptx/opc/spec.py +44 -0
  41. pptx/oxml/__init__.py +492 -0
  42. pptx/oxml/action.py +53 -0
  43. pptx/oxml/chart/__init__.py +0 -0
  44. pptx/oxml/chart/axis.py +297 -0
  45. pptx/oxml/chart/chart.py +282 -0
  46. pptx/oxml/chart/datalabel.py +252 -0
  47. pptx/oxml/chart/legend.py +72 -0
  48. pptx/oxml/chart/marker.py +61 -0
  49. pptx/oxml/chart/plot.py +345 -0
  50. pptx/oxml/chart/series.py +254 -0
  51. pptx/oxml/chart/shared.py +219 -0
  52. pptx/oxml/coreprops.py +288 -0
  53. pptx/oxml/dml/__init__.py +0 -0
  54. pptx/oxml/dml/color.py +111 -0
  55. pptx/oxml/dml/fill.py +197 -0
  56. pptx/oxml/dml/line.py +12 -0
  57. pptx/oxml/ns.py +129 -0
  58. pptx/oxml/presentation.py +130 -0
  59. pptx/oxml/shapes/__init__.py +19 -0
  60. pptx/oxml/shapes/autoshape.py +455 -0
  61. pptx/oxml/shapes/connector.py +107 -0
  62. pptx/oxml/shapes/graphfrm.py +342 -0
  63. pptx/oxml/shapes/groupshape.py +280 -0
  64. pptx/oxml/shapes/picture.py +270 -0
  65. pptx/oxml/shapes/shared.py +523 -0
  66. pptx/oxml/simpletypes.py +740 -0
  67. pptx/oxml/slide.py +347 -0
  68. pptx/oxml/table.py +588 -0
  69. pptx/oxml/text.py +748 -0
  70. pptx/oxml/theme.py +29 -0
  71. pptx/oxml/xmlchemy.py +717 -0
  72. pptx/package.py +222 -0
  73. pptx/parts/__init__.py +0 -0
  74. pptx/parts/chart.py +95 -0
  75. pptx/parts/coreprops.py +167 -0
  76. pptx/parts/embeddedpackage.py +93 -0
  77. pptx/parts/image.py +275 -0
  78. pptx/parts/media.py +37 -0
  79. pptx/parts/presentation.py +126 -0
  80. pptx/parts/slide.py +297 -0
  81. pptx/parts/theme.py +13 -0
  82. pptx/presentation.py +113 -0
  83. pptx/py.typed +0 -0
  84. pptx/shapes/__init__.py +26 -0
  85. pptx/shapes/autoshape.py +355 -0
  86. pptx/shapes/base.py +293 -0
  87. pptx/shapes/connector.py +297 -0
  88. pptx/shapes/freeform.py +337 -0
  89. pptx/shapes/graphfrm.py +166 -0
  90. pptx/shapes/group.py +69 -0
  91. pptx/shapes/picture.py +203 -0
  92. pptx/shapes/placeholder.py +407 -0
  93. pptx/shapes/shapetree.py +1190 -0
  94. pptx/shared.py +82 -0
  95. pptx/slide.py +577 -0
  96. pptx/spec.py +632 -0
  97. pptx/table.py +520 -0
  98. pptx/templates/default.pptx +0 -0
  99. pptx/templates/docx-icon.emf +0 -0
  100. pptx/templates/generic-icon.emf +0 -0
  101. pptx/templates/notes.xml +23 -0
  102. pptx/templates/notesMaster.xml +352 -0
  103. pptx/templates/pptx-icon.emf +0 -0
  104. pptx/templates/theme.xml +321 -0
  105. pptx/templates/xlsx-icon.emf +0 -0
  106. pptx/text/__init__.py +0 -0
  107. pptx/text/fonts.py +399 -0
  108. pptx/text/layout.py +325 -0
  109. pptx/text/text.py +770 -0
  110. pptx/theme.py +135 -0
  111. pptx/types.py +36 -0
  112. pptx/util.py +284 -0
  113. ps_python_pptx-1.1.0.dist-info/METADATA +75 -0
  114. ps_python_pptx-1.1.0.dist-info/RECORD +117 -0
  115. ps_python_pptx-1.1.0.dist-info/WHEEL +5 -0
  116. ps_python_pptx-1.1.0.dist-info/licenses/LICENSE +20 -0
  117. ps_python_pptx-1.1.0.dist-info/top_level.txt +1 -0
pptx/theme.py ADDED
@@ -0,0 +1,135 @@
1
+ """Public theme color and font scheme objects."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pptx.dml.color import RGBColor
6
+ from pptx.enum.dml import MSO_THEME_COLOR
7
+ from pptx.oxml.ns import qn
8
+ from pptx.oxml.xmlchemy import OxmlElement
9
+
10
+
11
+ class Theme:
12
+ """A theme shared by one or more masters. Changes affect every reference."""
13
+
14
+ def __init__(self, element):
15
+ self._element = element
16
+
17
+ @property
18
+ def name(self) -> str:
19
+ return self._element.get("name", "")
20
+
21
+ @name.setter
22
+ def name(self, value: str):
23
+ self._element.set("name", value)
24
+
25
+ @property
26
+ def color_scheme(self):
27
+ element = self._element.find("./" + qn("a:themeElements") + "/" + qn("a:clrScheme"))
28
+ if element is None:
29
+ raise ValueError("theme does not contain a color scheme")
30
+ return ThemeColorScheme(element)
31
+
32
+ @property
33
+ def font_scheme(self):
34
+ element = self._element.find("./" + qn("a:themeElements") + "/" + qn("a:fontScheme"))
35
+ if element is None:
36
+ raise ValueError("theme does not contain a font scheme")
37
+ return ThemeFontScheme(element)
38
+
39
+
40
+ class ThemeColorScheme:
41
+ """RGB colors indexed by the twelve base MSO_THEME_COLOR values.
42
+
43
+ System colors return their last saved RGB value. Unsupported color models
44
+ raise ValueError. Assignment replaces only the selected color definition.
45
+ """
46
+
47
+ _slots = (
48
+ "dk1",
49
+ "lt1",
50
+ "dk2",
51
+ "lt2",
52
+ "accent1",
53
+ "accent2",
54
+ "accent3",
55
+ "accent4",
56
+ "accent5",
57
+ "accent6",
58
+ "hlink",
59
+ "folHlink",
60
+ )
61
+
62
+ def __init__(self, element):
63
+ self._element = element
64
+
65
+ @property
66
+ def name(self) -> str:
67
+ return self._element.get("name", "")
68
+
69
+ @name.setter
70
+ def name(self, value: str):
71
+ self._element.set("name", value)
72
+
73
+ def _slot(self, key):
74
+ name = MSO_THEME_COLOR.to_xml(key)
75
+ if name not in self._slots:
76
+ raise KeyError(key)
77
+ slot = self._element.find(qn("a:" + name))
78
+ if slot is None:
79
+ raise ValueError("theme color slot is missing: " + name)
80
+ return slot
81
+
82
+ def __getitem__(self, key) -> RGBColor:
83
+ slot = self._slot(key)
84
+ if len(slot) == 0:
85
+ raise ValueError("theme color slot has no color")
86
+ color = slot[0]
87
+ if color.tag == qn("a:srgbClr"):
88
+ value = color.get("val")
89
+ elif color.tag == qn("a:sysClr"):
90
+ value = color.get("lastClr")
91
+ else:
92
+ raise ValueError("theme color is not RGB or a system color")
93
+ if value is None:
94
+ raise ValueError("theme color has no saved RGB value")
95
+ return RGBColor.from_string(value)
96
+
97
+ def __setitem__(self, key, value: RGBColor):
98
+ if not isinstance(value, RGBColor):
99
+ raise TypeError("theme colors require RGBColor values")
100
+ slot = self._slot(key)
101
+ color = OxmlElement("a:srgbClr")
102
+ color.set("val", str(value))
103
+ slot[:] = [color]
104
+
105
+
106
+ class ThemeFontScheme:
107
+ """Latin typefaces of the major (heading) and minor (body) font collections.
108
+
109
+ Editing Latin fonts preserves East Asian, complex script, and supplemental fonts.
110
+ """
111
+
112
+ def __init__(self, element):
113
+ self._element = element
114
+
115
+ def _latin(self, kind):
116
+ latin = self._element.find("./" + qn("a:" + kind + "Font") + "/" + qn("a:latin"))
117
+ if latin is None:
118
+ raise ValueError("theme font collection has no Latin font")
119
+ return latin
120
+
121
+ @property
122
+ def major_latin(self) -> str:
123
+ return self._latin("major").get("typeface", "")
124
+
125
+ @major_latin.setter
126
+ def major_latin(self, value: str):
127
+ self._latin("major").set("typeface", value)
128
+
129
+ @property
130
+ def minor_latin(self) -> str:
131
+ return self._latin("minor").get("typeface", "")
132
+
133
+ @minor_latin.setter
134
+ def minor_latin(self, value: str):
135
+ self._latin("minor").set("typeface", value)
pptx/types.py ADDED
@@ -0,0 +1,36 @@
1
+ """Abstract types used by `python-pptx`."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING
6
+
7
+ from typing_extensions import Protocol
8
+
9
+ if TYPE_CHECKING:
10
+ from pptx.opc.package import XmlPart
11
+ from pptx.util import Length
12
+
13
+
14
+ class ProvidesExtents(Protocol):
15
+ """An object that has width and height."""
16
+
17
+ @property
18
+ def height(self) -> Length:
19
+ """Distance between top and bottom extents of shape in EMUs."""
20
+ ...
21
+
22
+ @property
23
+ def width(self) -> Length:
24
+ """Distance between left and right extents of shape in EMUs."""
25
+ ...
26
+
27
+
28
+ class ProvidesPart(Protocol):
29
+ """An object that provides access to its XmlPart.
30
+
31
+ This type is for objects that need access to their part, possibly because they need access to
32
+ the package or related parts.
33
+ """
34
+
35
+ @property
36
+ def part(self) -> XmlPart: ...
pptx/util.py ADDED
@@ -0,0 +1,284 @@
1
+ """Utility functions and classes."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import functools
6
+ from typing import Any, Callable, Generic, TypeVar, cast
7
+
8
+ from pptx.enum.text import MSO_NUMBERED_BULLET_STYLE, BulletStyleType
9
+
10
+
11
+ class Length(int):
12
+ """Base class for length classes Inches, Emu, Cm, Mm, and Pt.
13
+
14
+ Provides properties for converting length values to convenient units.
15
+ """
16
+
17
+ _EMUS_PER_INCH = 914400
18
+ _EMUS_PER_CENTIPOINT = 127
19
+ _EMUS_PER_CM = 360000
20
+ _EMUS_PER_MM = 36000
21
+ _EMUS_PER_PT = 12700
22
+
23
+ def __new__(cls, emu: int):
24
+ return int.__new__(cls, emu)
25
+
26
+ @property
27
+ def inches(self) -> float:
28
+ """Floating point length in inches."""
29
+ return self / float(self._EMUS_PER_INCH)
30
+
31
+ @property
32
+ def centipoints(self) -> int:
33
+ """Integer length in hundredths of a point (1/7200 inch).
34
+
35
+ Used internally because PowerPoint stores font size in centipoints.
36
+ """
37
+ return self // self._EMUS_PER_CENTIPOINT
38
+
39
+ @property
40
+ def cm(self) -> float:
41
+ """Floating point length in centimeters."""
42
+ return self / float(self._EMUS_PER_CM)
43
+
44
+ @property
45
+ def emu(self) -> int:
46
+ """Integer length in English Metric Units."""
47
+ return self
48
+
49
+ @property
50
+ def mm(self) -> float:
51
+ """Floating point length in millimeters."""
52
+ return self / float(self._EMUS_PER_MM)
53
+
54
+ @property
55
+ def pt(self) -> float:
56
+ """Floating point length in points."""
57
+ return self / float(self._EMUS_PER_PT)
58
+
59
+
60
+ class Inches(Length):
61
+ """Convenience constructor for length in inches."""
62
+
63
+ def __new__(cls, inches: float):
64
+ emu = int(inches * Length._EMUS_PER_INCH)
65
+ return Length.__new__(cls, emu)
66
+
67
+
68
+ class Centipoints(Length):
69
+ """Convenience constructor for length in hundredths of a point."""
70
+
71
+ def __new__(cls, centipoints: int):
72
+ emu = int(centipoints * Length._EMUS_PER_CENTIPOINT)
73
+ return Length.__new__(cls, emu)
74
+
75
+
76
+ class Cm(Length):
77
+ """Convenience constructor for length in centimeters."""
78
+
79
+ def __new__(cls, cm: float):
80
+ emu = int(cm * Length._EMUS_PER_CM)
81
+ return Length.__new__(cls, emu)
82
+
83
+
84
+ class Emu(Length):
85
+ """Convenience constructor for length in english metric units."""
86
+
87
+ def __new__(cls, emu: int):
88
+ return Length.__new__(cls, int(emu))
89
+
90
+
91
+ class Mm(Length):
92
+ """Convenience constructor for length in millimeters."""
93
+
94
+ def __new__(cls, mm: float):
95
+ emu = int(mm * Length._EMUS_PER_MM)
96
+ return Length.__new__(cls, emu)
97
+
98
+
99
+ class Pt(Length):
100
+ """Convenience value class for specifying a length in points."""
101
+
102
+ def __new__(cls, points: float):
103
+ emu = int(points * Length._EMUS_PER_PT)
104
+ return Length.__new__(cls, emu)
105
+
106
+
107
+ class BulletStyle:
108
+ """Convenience value class for styling unnumbered bullets.
109
+
110
+ ``BulletStyle.NO_BULLET`` indicates that bullets are explicitly disabled
111
+ a paragraph. ``BulletStyle.DEFAULT`` indicates that whether the paragraph
112
+ is rendered as a bullet is defined in the slide master or layout.
113
+
114
+ The methods ``BulletStyle.custom`` and ``BulletStyle.numbered`` can be
115
+ used to create ``BulletStyle``s that control what kind of bullet is used
116
+ for the paragraph.
117
+ """
118
+
119
+ NO_BULLET: BulletStyle = None
120
+ DEFAULT: BulletStyle = None
121
+
122
+ def __init__(
123
+ self,
124
+ style: BulletStyleType,
125
+ value: str | MSO_NUMBERED_BULLET_STYLE | None = None,
126
+ start_at: int | None = None,
127
+ ):
128
+ if start_at is not None:
129
+ if isinstance(start_at, bool) or not isinstance(start_at, int):
130
+ raise TypeError("start_at must be an integer or None")
131
+ if style != BulletStyleType.NUMBERED or not 1 <= start_at <= 32767:
132
+ raise ValueError("start_at requires a numbered bullet and must be 1..32767")
133
+ self._style = style
134
+ self._value = value
135
+ self._start_at = start_at
136
+
137
+ def __eq__(self, other: object):
138
+ if isinstance(other, BulletStyle) and self._style == other._style:
139
+ return self._value == other._value and self._start_at == other._start_at
140
+ else:
141
+ return False
142
+
143
+ @property
144
+ def start_at(self) -> int | None:
145
+ """Explicit first number, or None for automatic continuation."""
146
+ return self._start_at
147
+
148
+ @property
149
+ def value(self) -> str | MSO_NUMBERED_BULLET_STYLE | None:
150
+ return self._value
151
+
152
+ @property
153
+ def style(self) -> BulletStyleType:
154
+ return self._style
155
+
156
+ @classmethod
157
+ def custom(cls, bullet_string: str):
158
+ """Defines a bullet that is rendered as ``bullet_string``."""
159
+ return BulletStyle(BulletStyleType.CUSTOM, bullet_string)
160
+
161
+ @classmethod
162
+ def numbered(cls, style: MSO_NUMBERED_BULLET_STYLE, start_at: int | None = None):
163
+ """Defines a bullet that is numbered.
164
+
165
+ The style of the enumeration is controlled by the ``style`` and
166
+ is a ``MSO_NUMBERED_BULLET_STYLE``.
167
+ """
168
+ return BulletStyle(BulletStyleType.NUMBERED, style, start_at)
169
+
170
+
171
+ BulletStyle.NO_BULLET = BulletStyle(BulletStyleType.NO_BULLET)
172
+ BulletStyle.DEFAULT = BulletStyle(BulletStyleType.DEFAULT)
173
+
174
+
175
+ _T = TypeVar("_T")
176
+
177
+
178
+ class lazyproperty(Generic[_T]):
179
+ """Decorator like @property, but evaluated only on first access.
180
+
181
+ Like @property, this can only be used to decorate methods having only a `self` parameter, and
182
+ is accessed like an attribute on an instance, i.e. trailing parentheses are not used. Unlike
183
+ @property, the decorated method is only evaluated on first access; the resulting value is
184
+ cached and that same value returned on second and later access without re-evaluation of the
185
+ method.
186
+
187
+ Like @property, this class produces a *data descriptor* object, which is stored in the __dict__
188
+ of the *class* under the name of the decorated method ('fget' nominally). The cached value is
189
+ stored in the __dict__ of the *instance* under that same name.
190
+
191
+ Because it is a data descriptor (as opposed to a *non-data descriptor*), its `__get__()` method
192
+ is executed on each access of the decorated attribute; the __dict__ item of the same name is
193
+ "shadowed" by the descriptor.
194
+
195
+ While this may represent a performance improvement over a property, its greater benefit may be
196
+ its other characteristics. One common use is to construct collaborator objects, removing that
197
+ "real work" from the constructor, while still only executing once. It also de-couples client
198
+ code from any sequencing considerations; if it's accessed from more than one location, it's
199
+ assured it will be ready whenever needed.
200
+
201
+ Loosely based on: https://stackoverflow.com/a/6849299/1902513.
202
+
203
+ A lazyproperty is read-only. There is no counterpart to the optional "setter" (or deleter)
204
+ behavior of an @property. This is critically important to maintaining its immutability and
205
+ idempotence guarantees. Attempting to assign to a lazyproperty raises AttributeError
206
+ unconditionally.
207
+
208
+ The parameter names in the methods below correspond to this usage example::
209
+
210
+ class Obj(object)
211
+
212
+ @lazyproperty
213
+ def fget(self):
214
+ return 'some result'
215
+
216
+ obj = Obj()
217
+
218
+ Not suitable for wrapping a function (as opposed to a method) because it is not callable.
219
+ """
220
+
221
+ def __init__(self, fget: Callable[..., _T]) -> None:
222
+ """*fget* is the decorated method (a "getter" function).
223
+
224
+ A lazyproperty is read-only, so there is only an *fget* function (a regular
225
+ @property can also have an fset and fdel function). This name was chosen for
226
+ consistency with Python's `property` class which uses this name for the
227
+ corresponding parameter.
228
+ """
229
+ # --- maintain a reference to the wrapped getter method
230
+ self._fget = fget
231
+ # --- and store the name of that decorated method
232
+ self._name = fget.__name__
233
+ # --- adopt fget's __name__, __doc__, and other attributes
234
+ functools.update_wrapper(self, fget) # pyright: ignore
235
+
236
+ def __get__(self, obj: Any, type: Any = None) -> _T:
237
+ """Called on each access of 'fget' attribute on class or instance.
238
+
239
+ *self* is this instance of a lazyproperty descriptor "wrapping" the property
240
+ method it decorates (`fget`, nominally).
241
+
242
+ *obj* is the "host" object instance when the attribute is accessed from an
243
+ object instance, e.g. `obj = Obj(); obj.fget`. *obj* is None when accessed on
244
+ the class, e.g. `Obj.fget`.
245
+
246
+ *type* is the class hosting the decorated getter method (`fget`) on both class
247
+ and instance attribute access.
248
+ """
249
+ # --- when accessed on class, e.g. Obj.fget, just return this descriptor
250
+ # --- instance (patched above to look like fget).
251
+ if obj is None:
252
+ return self # type: ignore
253
+
254
+ # --- when accessed on instance, start by checking instance __dict__ for
255
+ # --- item with key matching the wrapped function's name
256
+ value = obj.__dict__.get(self._name)
257
+ if value is None:
258
+ # --- on first access, the __dict__ item will be absent. Evaluate fget()
259
+ # --- and store that value in the (otherwise unused) host-object
260
+ # --- __dict__ value of same name ('fget' nominally)
261
+ value = self._fget(obj)
262
+ obj.__dict__[self._name] = value
263
+ return cast(_T, value)
264
+
265
+ def __set__(self, obj: Any, value: Any) -> None:
266
+ """Raises unconditionally, to preserve read-only behavior.
267
+
268
+ This decorator is intended to implement immutable (and idempotent) object
269
+ attributes. For that reason, assignment to this property must be explicitly
270
+ prevented.
271
+
272
+ If this __set__ method was not present, this descriptor would become a
273
+ *non-data descriptor*. That would be nice because the cached value would be
274
+ accessed directly once set (__dict__ attrs have precedence over non-data
275
+ descriptors on instance attribute lookup). The problem is, there would be
276
+ nothing to stop assignment to the cached value, which would overwrite the result
277
+ of `fget()` and break both the immutability and idempotence guarantees of this
278
+ decorator.
279
+
280
+ The performance with this __set__() method in place was roughly 0.4 usec per
281
+ access when measured on a 2.8GHz development machine; so quite snappy and
282
+ probably not a rich target for optimization efforts.
283
+ """
284
+ raise AttributeError("can't set attribute")
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.4
2
+ Name: ps-python-pptx
3
+ Version: 1.1.0
4
+ Summary: Python-pptx fork with public APIs for themes, backgrounds, lists, and rich text.
5
+ Author-email: Steve Canny <stcanny@gmail.com>
6
+ License: MIT
7
+ Project-URL: Changelog, https://github.com/pseudosavant/python-pptx/blob/master/HISTORY.rst
8
+ Project-URL: Documentation, https://python-pptx.readthedocs.io/en/latest/
9
+ Project-URL: Homepage, https://github.com/pseudosavant/python-pptx
10
+ Project-URL: Repository, https://github.com/pseudosavant/python-pptx
11
+ Keywords: powerpoint,ppt,pptx,openxml,office
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Office/Business :: Office Suites
25
+ Classifier: Topic :: Software Development :: Libraries
26
+ Requires-Python: >=3.8
27
+ Description-Content-Type: text/x-rst
28
+ License-File: LICENSE
29
+ Requires-Dist: Pillow>=3.3.2
30
+ Requires-Dist: XlsxWriter>=0.5.7
31
+ Requires-Dist: lxml>=3.1.0
32
+ Requires-Dist: typing_extensions>=4.9.0
33
+ Dynamic: license-file
34
+
35
+ ps-python-pptx
36
+ ==============
37
+
38
+ This is the pseudosavant fork of python-pptx, published as ps-python-pptx.
39
+ It retains the pptx import package and the upstream MIT license and attribution.
40
+
41
+ Install with pip install ps-python-pptx. Use a fresh environment when switching
42
+ from python-pptx because both distributions provide the same import package.
43
+
44
+ Version 1.1.0 adds public APIs for alternative text and titles, shape stacking,
45
+ table styles, baseline shifts, strikethrough, paragraph bullets and indents,
46
+ theme colors and fonts, slide clearing, and explicit gradient/picture backgrounds.
47
+ See FORK.md for feature branches, upstream proposals, and release conventions.
48
+
49
+ Upstream project documentation follows.
50
+
51
+ *python-pptx* is a Python library for creating, reading, and updating PowerPoint (.pptx)
52
+ files.
53
+
54
+ A typical use would be generating a PowerPoint presentation from dynamic content such as
55
+ a database query, analytics output, or a JSON payload, perhaps in response to an HTTP
56
+ request and downloading the generated PPTX file in response. It runs on any Python
57
+ capable platform, including macOS and Linux, and does not require the PowerPoint
58
+ application to be installed or licensed.
59
+
60
+ It can also be used to analyze PowerPoint files from a corpus, perhaps to extract search
61
+ indexing text and images.
62
+
63
+ In can also be used to simply automate the production of a slide or two that would be
64
+ tedious to get right by hand, which is how this all got started.
65
+
66
+ More information is available in the `python-pptx documentation`_.
67
+
68
+ Browse `examples with screenshots`_ to get a quick idea what you can do with
69
+ python-pptx.
70
+
71
+ .. _`python-pptx documentation`:
72
+ https://python-pptx.readthedocs.org/en/latest/
73
+
74
+ .. _`examples with screenshots`:
75
+ https://python-pptx.readthedocs.org/en/latest/user/quickstart.html
@@ -0,0 +1,117 @@
1
+ pptx/__init__.py,sha256=wGedXa8j1YcMWnjf2sPzh2JFLvYq_kdagyNE0Oqijo0,2168
2
+ pptx/action.py,sha256=NiaoG75EYyLemHYUkV5zNB93ZwS5A39uTY9I_K0P_b0,9638
3
+ pptx/api.py,sha256=IrGxa35Z6tyZBxaBuknyROdmHKNI8XUa77XU62xBFFM,1737
4
+ pptx/exc.py,sha256=5ahr42pL5ELGHFD0YFCAYp17YEm_DkXUymyt2ENFX_Q,473
5
+ pptx/media.py,sha256=L5CdNiUpKdl6AtPkaUncT2pilunKNFYusaWaUCPqREA,10580
6
+ pptx/package.py,sha256=tOCC3d5cYu9QrKnwrS-WFo5jyacW2z6LfWNB4-WoeF8,7857
7
+ pptx/presentation.py,sha256=VP2k0_PC2YooLVVQQ6CMStRKRXIOVAeU72JtZVM99us,3810
8
+ pptx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ pptx/shared.py,sha256=3Q2VuZ5-rHoLaKOkkSbD_5PmtajiHmY1gamWJeycwnw,2745
10
+ pptx/slide.py,sha256=HNdCVnexBtKZXqxHm-Q0dcfEidMjq8tR_GSTd_ZqHOI,22084
11
+ pptx/spec.py,sha256=VXHEzz3OBn0-0Cx2_Zcf5o0zEXK9QHzulTUenST0RUU,23869
12
+ pptx/table.py,sha256=g9oD8gk5zMUyPkIPK1iwYsQVd0SwQOMUJU7wSUrebdM,17980
13
+ pptx/theme.py,sha256=Zq1hTCmBOOmjMky0wUhOFEdILcTBQL7OJUTDnL9_0gw,3981
14
+ pptx/types.py,sha256=i_FRALF6-rhmtfZW17iNXmWWO4K2VYjOYjZIA45gYv8,867
15
+ pptx/util.py,sha256=8OKOe5DPl2hw5PccIxfgXZfA3cikobnKQscglu16AWU,10556
16
+ pptx/chart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ pptx/chart/axis.py,sha256=Nbo271Wn7vZLznvHxFZb3VVraSg41kLsS1o470eFkJs,17321
18
+ pptx/chart/category.py,sha256=j5t_ckG7iNmsab43yS3QKfMIM2KXSIVD94jHT6k8S_0,7187
19
+ pptx/chart/chart.py,sha256=5B6nBWfUunNoFR3ykDUqYjfjw7CMiAg7cium-ISIc5g,9958
20
+ pptx/chart/data.py,sha256=TV1sZ--etBDqmXDzGw_luK87AgXOe0G4fEd4ZlPOwRc,29753
21
+ pptx/chart/datalabel.py,sha256=MIUAFN_NnLcyVA6hpTke1XSHRUsB2m9mYhwsWKcWIuA,9465
22
+ pptx/chart/legend.py,sha256=eY9e_NCTEqf689lYrwW7Hsb4ax8PwZ0tpzsUG43pT7w,2516
23
+ pptx/chart/marker.py,sha256=SdgA2M4wKK6wNe584uGUHr2ay5zrcb1hRXzeQIhlId8,2072
24
+ pptx/chart/plot.py,sha256=iORWuJdX5cMs_Ly91gNaqIa901qaYINb7s7jDdUvkOA,13168
25
+ pptx/chart/point.py,sha256=xByuKEmn6e8HYmELVTRvR8FIt7IB1k8EAoF6D1unij0,2735
26
+ pptx/chart/series.py,sha256=N6wWESsAYWIPF8LQQ3-brZH0CH8oSk7FhjABlAJ8C8E,7400
27
+ pptx/chart/xlsx.py,sha256=E7ZjcRVMhtFrGf1NhUF36n8Qrng6xOgIZL2xWDLjCxc,10840
28
+ pptx/chart/xmlwriter.py,sha256=qyIBh48U6WV5j_9a3X3zmJOs87918wa1mivqQmE4udw,67352
29
+ pptx/dml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
+ pptx/dml/chtfmt.py,sha256=mGn-j0p4c49ulFMjl9jCzZ3rKdYAfRd2gCYWcPNWW6M,1328
31
+ pptx/dml/color.py,sha256=ox6uGOGyK2glWCSGnRcnsoY7pUXzMUFGLzZGv3CpAhw,9071
32
+ pptx/dml/effect.py,sha256=0jtUCzrK86uS0J9LIze9GnGFI2_Ht_N9XPWDsUOwi30,1525
33
+ pptx/dml/fill.py,sha256=wekI1xLchL-_lrOvT_JUV2hAuftxLDIyqheni7ifuwU,16657
34
+ pptx/dml/line.py,sha256=_suJhCkiTgZSkcTIR3hoL0cuaGQO1EEdXLIGI35KDtw,3055
35
+ pptx/enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
+ pptx/enum/action.py,sha256=eegOw3SJmjL8rbKXjc9ME4SBQJWQV9btHNznN43q18c,1743
37
+ pptx/enum/base.py,sha256=65sBQIA7GdMIjkgrN0pbbuqwW8Lu7vh4h52awi9JXJY,5844
38
+ pptx/enum/chart.py,sha256=Nhtzuh49_4Mg98dzMfjfx9-fMmrpmOMKUnSzmS2m6o4,14025
39
+ pptx/enum/dml.py,sha256=z1tTGdUT7R0Yg-wLRKALrq21pfBO1dwVaWUKbRbZJsg,12053
40
+ pptx/enum/lang.py,sha256=Fmp1VNU4Z2u804GttMhXHO_1l_1nVv8QS-vMKL4sXgA,22431
41
+ pptx/enum/shapes.py,sha256=KWqce1DFUh5sKc6sr1S4uusHKv-2-dBR6q-dr3tNBRI,29725
42
+ pptx/enum/text.py,sha256=p0VpABRrKm1dAmJ_wmtSBXs-Y3-hT4vsDV84iaBUego,13372
43
+ pptx/opc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
+ pptx/opc/constants.py,sha256=kYqJBVEBZloOpRNf6IDiS9C12okKisuDv9cwmdTUtGc,18075
45
+ pptx/opc/oxml.py,sha256=eTji--njPbUcVIEDPBl5tIGU3VnLOxSYiYEeWvd4qAQ,6083
46
+ pptx/opc/package.py,sha256=wj2K6s-Gvaw6T6VfW82f0GRLwZQuFIPe3yyXtBItons,30062
47
+ pptx/opc/packuri.py,sha256=ljdhyycAcnnKsC31sFBweOOPTdCC23R50D5yYlop_Mc,3811
48
+ pptx/opc/serialized.py,sha256=7iH3v3Ln95W26P1C0XYswvPONdwTp-hM_ld7QB5lXHQ,11437
49
+ pptx/opc/shared.py,sha256=moVes6J3hp4BrXQTZfkoVJldxfr9LUzMtxhtl6nkYOw,709
50
+ pptx/opc/spec.py,sha256=Adxgld3M-kTbWTwm27YNwPUPl7Ajh3anXTiwgYLbIDo,998
51
+ pptx/oxml/__init__.py,sha256=m3tZMaKa9C7d-zm6NRQATenNq3uHPc65_DPeBOdPB24,15869
52
+ pptx/oxml/action.py,sha256=XM8-gextGC6bTP4RCZHoDDfO-8qBaVpq6fuhSLjYhFA,1612
53
+ pptx/oxml/coreprops.py,sha256=Q32m6gMBqlH2WA7XtXBxD60vdWY1DEuFJQX2w8CjfFw,10419
54
+ pptx/oxml/ns.py,sha256=En3N2dpK2eJb_E7w5korgxrYEDU_yFkHdpPR5eDkzLU,4761
55
+ pptx/oxml/presentation.py,sha256=sh2DAaEg5PdIV3vXIeeX4RgJIALZ4UbRqDOF9hUFvV4,4252
56
+ pptx/oxml/simpletypes.py,sha256=8FobKKtkKTAsPSxUc9HovXDHjQ9IrkmOW5cJFWYAlm8,19814
57
+ pptx/oxml/slide.py,sha256=C5XoRlORRcuab-SKx8R7uXYXI4IwrpVRtX-nd1Dm9q0,11301
58
+ pptx/oxml/table.py,sha256=XZwe_0a_j4MmaxqCOe_Y0vq86zjojtWejiIiDC4E-_o,20095
59
+ pptx/oxml/text.py,sha256=wVivxln6BULZELrepQZ6Qnu5iL2z-MFGj0_Qr4S8uOA,25288
60
+ pptx/oxml/theme.py,sha256=MylRo56qKmGt6W4fdFUFbge_2CMA4MImtsnUi_dDonU,685
61
+ pptx/oxml/xmlchemy.py,sha256=QrKG9ghMYiaOUZdZEGjCneDV9EY7z5-8ABmTkQAQn3U,26913
62
+ pptx/oxml/chart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
+ pptx/oxml/chart/axis.py,sha256=HsLcT9laRtLfCv6DouiU3LsN_IEXjKeYSEHrTs1Gjyc,9404
64
+ pptx/oxml/chart/chart.py,sha256=nrmpPpKxqvJKDLvAb2g27lNcKTiJYXc6Ns0I9Le0X8A,8114
65
+ pptx/oxml/chart/datalabel.py,sha256=gB40Ph2keuhoXWz1HtaUU9OjznHQSW9f5ZewfeuvUys,7698
66
+ pptx/oxml/chart/legend.py,sha256=ORDiVRmZf3FmJeoVKm4jq9xAE7RSPN9FFuDrdGzI4oA,2088
67
+ pptx/oxml/chart/marker.py,sha256=Ze2qBe48QGvEPcbqAv7-TAEokmMb6M3qQGKHgaZFdUY,1787
68
+ pptx/oxml/chart/plot.py,sha256=OSSjy65Np3NTj3FsfSys1SCFDV-be4hpq7hCaG3iooE,9196
69
+ pptx/oxml/chart/series.py,sha256=JyzxYXgOajsoTAc6RarFzvBtlcfTiEL7fiKoKrX6FNc,7597
70
+ pptx/oxml/chart/shared.py,sha256=3us38XQawtl7Cjg88NdiViZiXNnDkLXsP2TZ0FHcWVI,5994
71
+ pptx/oxml/dml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
+ pptx/oxml/dml/color.py,sha256=h_uZpTTeLnFeNtE9bsOZk8_7X0a4qvr6Ght6XXyKcSo,2470
73
+ pptx/oxml/dml/fill.py,sha256=Ct1YQ7YqDYk--xZiO05-UhiXwE1rjglcT383eOJqYdk,5912
74
+ pptx/oxml/dml/line.py,sha256=grAfyADcxc9dzHwsXlQzd7OzJ9-yCpor411C83-uhTo,379
75
+ pptx/oxml/shapes/__init__.py,sha256=NM8rAeLR_29U_4rJJJUxrskuEnYqdLRRzFVkfYq8Y-o,588
76
+ pptx/oxml/shapes/autoshape.py,sha256=p7-D8EBh3YVY5Bywi6XW9sL-nmUK-iG04fr2_65DvGo,14763
77
+ pptx/oxml/shapes/connector.py,sha256=GvmnPOnU8hySVO_sy9fnsvzRHpMJDzR-mlntxANgFXE,3628
78
+ pptx/oxml/shapes/graphfrm.py,sha256=KGzhnGp8rFhhSb2J3156ATmSy8lwDfz0OS3CAl1GtRg,13080
79
+ pptx/oxml/shapes/groupshape.py,sha256=CBRBw1Df2k2UviaOv1Wh32G9I0IrIZtAoIvsRoXqt_A,9989
80
+ pptx/oxml/shapes/picture.py,sha256=e9l4dVrby_M5P0eZVs7J2yVjMrSmeCoqYSgpR4N2hpE,8532
81
+ pptx/oxml/shapes/shared.py,sha256=iJcxXDoz4jqruwKAaEsxDeNvYADR92fVZV0yMmFA98g,13962
82
+ pptx/parts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
+ pptx/parts/chart.py,sha256=BMJfbuxneVxBmLnlKGcYWytu1tzAu7US-G775IwVKP0,3212
84
+ pptx/parts/coreprops.py,sha256=UtdrXYmvxy5mwPCXQMRRNu6athZ4giw7BhIwe-vNTs8,4435
85
+ pptx/parts/embeddedpackage.py,sha256=Xhh8_BQWl__4NyaqJlT85C8vkIP-_BaxmBu_gyrDEj8,2979
86
+ pptx/parts/image.py,sha256=KYY0HFU10VUc9gHLa3_r64NH-G6dcPbJkuxho0XezfQ,9617
87
+ pptx/parts/media.py,sha256=5hX0Ipd57D3K_Cg9-4uneSy4_93WExuTv6yv3Zhi5R0,918
88
+ pptx/parts/presentation.py,sha256=JUA6-DwNlEWghqEXTBdLpI-oBsCMO39J26RrQEh0daA,4840
89
+ pptx/parts/slide.py,sha256=93KbGlLzimXj3K5ROtyfBT86SRd4uHEcyz3MO22K7uo,10776
90
+ pptx/parts/theme.py,sha256=hsMO7exHYocYcW8-_txgEjUgCYSpOkhWsp339HK0dsA,290
91
+ pptx/shapes/__init__.py,sha256=TcsN0EA_foZI5RBOAEDjPehbkr666v47odzvgbkB_wI,720
92
+ pptx/shapes/autoshape.py,sha256=aIJQbVvtFkAHAQ1IenCAUuWPCr1Jf3zxVjh9Z_k9sq0,13751
93
+ pptx/shapes/base.py,sha256=1h9K6AoK9JYGX6Lq4DZgvsL8uLCJAfkKRd7P-AccG1Q,9862
94
+ pptx/shapes/connector.py,sha256=dC0loZ5dbQE4hAlEB-FI6FwJ8-LjquVyhj8M8VEkHj8,9996
95
+ pptx/shapes/freeform.py,sha256=aLym3WM_r3L-MmjifVpm5BMmA3bmAJDjX8jEJ8gT_hw,12460
96
+ pptx/shapes/graphfrm.py,sha256=UxlrzM7VCrHRdH8YRWLG05dh8s6c0fhUP10h4H5O9jE,6107
97
+ pptx/shapes/group.py,sha256=U8XjtoUUkO-3D_hvBMRH78c7rsobFEiYUWbBtQ2hHQk,2232
98
+ pptx/shapes/picture.py,sha256=daxZMzuuFjYNtdldBEP0tJE2FmoQ5SclnYdZQz_wXP8,6853
99
+ pptx/shapes/placeholder.py,sha256=e7m8a_VXKZwxs2tjkNJ6C9oB9ALS3MAM4FWATZCS9gA,14772
100
+ pptx/shapes/shapetree.py,sha256=G-xy-9Ffb6q80CJCn_tV7mgbI3pFzJJv2H1rup_dR4w,47412
101
+ pptx/templates/default.pptx,sha256=4QzJ4SCWH2vUB0o3PJyA0qBsSXFX6PSXKXe3vqg6jzQ,34030
102
+ pptx/templates/docx-icon.emf,sha256=y_oFGqXx7BmT8M4Fb2cRLOSvOow6xvzPwhk5ntbcYl0,127228
103
+ pptx/templates/generic-icon.emf,sha256=4StblVWVPW7u9MJOnGo8KnBz4errqIJSkepLeFcrlV4,5396
104
+ pptx/templates/notes.xml,sha256=qPFPJ1z3YW4VxhIWr-NqrHBsPnx8Tph71DPGWAkRDQM,722
105
+ pptx/templates/notesMaster.xml,sha256=H7k5cUrQVx10fZ5XP5oFlAYqiec8agdtlDun9UEHKBM,11135
106
+ pptx/templates/pptx-icon.emf,sha256=f5dlgqbZT-VrZc5tO-9atXRqb2UnGJebEyWjHForTl0,5492
107
+ pptx/templates/theme.xml,sha256=dve9855TM0g-QvnE9uujRDMGF7bmFxt6QDnCORMam00,10964
108
+ pptx/templates/xlsx-icon.emf,sha256=FOUpNs698W5aZinOcHQVwmEi_lSvMihyotJf7GGKae4,130380
109
+ pptx/text/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
+ pptx/text/fonts.py,sha256=dvkIW1jTVR2PbsAblB-lNA0xYkp86VeUKJC6DOCbu3c,12863
111
+ pptx/text/layout.py,sha256=bkZjiRmoIrFMlcmonoROfgfgrgLCc9BRXKiCkWwB7W0,10232
112
+ pptx/text/text.py,sha256=IxVURbpxvWCfof7607RSJO2eJqwoX0bqLSY1Nfmoopg,28472
113
+ ps_python_pptx-1.1.0.dist-info/licenses/LICENSE,sha256=dlLyceRtDVM-ncRj87X8vcrPTWqcjWtVTRXv0PN_YTI,1104
114
+ ps_python_pptx-1.1.0.dist-info/METADATA,sha256=9b-xqWk-1o5p3uzNTqXy88eKd8JY3Y9N8pwd3dc4WlA,3273
115
+ ps_python_pptx-1.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
116
+ ps_python_pptx-1.1.0.dist-info/top_level.txt,sha256=O4BUPv9c3_6OQNtaneqNqq32Dp1TFyKK-K9CVNPenF8,5
117
+ ps_python_pptx-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2013 Steve Canny, https://github.com/scanny
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
@@ -0,0 +1 @@
1
+ pptx