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/enum/dml.py ADDED
@@ -0,0 +1,405 @@
1
+ """Enumerations used by DrawingML objects."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pptx.enum.base import BaseEnum, BaseXmlEnum
6
+
7
+
8
+ class MSO_COLOR_TYPE(BaseEnum):
9
+ """
10
+ Specifies the color specification scheme
11
+
12
+ Example::
13
+
14
+ from pptx.enum.dml import MSO_COLOR_TYPE
15
+
16
+ assert shape.fill.fore_color.type == MSO_COLOR_TYPE.SCHEME
17
+
18
+ MS API Name: "MsoColorType"
19
+
20
+ http://msdn.microsoft.com/en-us/library/office/ff864912(v=office.15).aspx
21
+ """
22
+
23
+ RGB = (1, "Color is specified by an |RGBColor| value.")
24
+ """Color is specified by an |RGBColor| value."""
25
+
26
+ SCHEME = (2, "Color is one of the preset theme colors")
27
+ """Color is one of the preset theme colors"""
28
+
29
+ HSL = (101, "Color is specified using Hue, Saturation, and Luminosity values")
30
+ """Color is specified using Hue, Saturation, and Luminosity values"""
31
+
32
+ PRESET = (102, "Color is specified using a named built-in color")
33
+ """Color is specified using a named built-in color"""
34
+
35
+ SCRGB = (103, "Color is an scRGB color, a wide color gamut RGB color space")
36
+ """Color is an scRGB color, a wide color gamut RGB color space"""
37
+
38
+ SYSTEM = (
39
+ 104,
40
+ "Color is one specified by the operating system, such as the window background color.",
41
+ )
42
+ """Color is one specified by the operating system, such as the window background color."""
43
+
44
+
45
+ class MSO_FILL_TYPE(BaseEnum):
46
+ """
47
+ Specifies the type of bitmap used for the fill of a shape.
48
+
49
+ Alias: ``MSO_FILL``
50
+
51
+ Example::
52
+
53
+ from pptx.enum.dml import MSO_FILL
54
+
55
+ assert shape.fill.type == MSO_FILL.SOLID
56
+
57
+ MS API Name: `MsoFillType`
58
+
59
+ http://msdn.microsoft.com/EN-US/library/office/ff861408.aspx
60
+ """
61
+
62
+ BACKGROUND = (
63
+ 5,
64
+ "The shape is transparent, such that whatever is behind the shape shows through."
65
+ " Often this is the slide background, but if a visible shape is behind, that will"
66
+ " show through.",
67
+ )
68
+ """The shape is transparent, such that whatever is behind the shape shows through.
69
+
70
+ Often this is the slide background, but if a visible shape is behind, that will show through.
71
+ """
72
+
73
+ GRADIENT = (3, "Shape is filled with a gradient")
74
+ """Shape is filled with a gradient"""
75
+
76
+ GROUP = (101, "Shape is part of a group and should inherit the fill properties of the group.")
77
+ """Shape is part of a group and should inherit the fill properties of the group."""
78
+
79
+ PATTERNED = (2, "Shape is filled with a pattern")
80
+ """Shape is filled with a pattern"""
81
+
82
+ PICTURE = (6, "Shape is filled with a bitmapped image")
83
+ """Shape is filled with a bitmapped image"""
84
+
85
+ SOLID = (1, "Shape is filled with a solid color")
86
+ """Shape is filled with a solid color"""
87
+
88
+ TEXTURED = (4, "Shape is filled with a texture")
89
+ """Shape is filled with a texture"""
90
+
91
+
92
+ MSO_FILL = MSO_FILL_TYPE
93
+
94
+
95
+ class MSO_LINE_DASH_STYLE(BaseXmlEnum):
96
+ """Specifies the dash style for a line.
97
+
98
+ Alias: ``MSO_LINE``
99
+
100
+ Example::
101
+
102
+ from pptx.enum.dml import MSO_LINE
103
+
104
+ shape.line.dash_style = MSO_LINE.DASH_DOT_DOT
105
+
106
+ MS API name: `MsoLineDashStyle`
107
+
108
+ https://learn.microsoft.com/en-us/office/vba/api/Office.MsoLineDashStyle
109
+ """
110
+
111
+ DASH = (4, "dash", "Line consists of dashes only.")
112
+ """Line consists of dashes only."""
113
+
114
+ DASH_DOT = (5, "dashDot", "Line is a dash-dot pattern.")
115
+ """Line is a dash-dot pattern."""
116
+
117
+ DASH_DOT_DOT = (6, "lgDashDotDot", "Line is a dash-dot-dot pattern.")
118
+ """Line is a dash-dot-dot pattern."""
119
+
120
+ LONG_DASH = (7, "lgDash", "Line consists of long dashes.")
121
+ """Line consists of long dashes."""
122
+
123
+ LONG_DASH_DOT = (8, "lgDashDot", "Line is a long dash-dot pattern.")
124
+ """Line is a long dash-dot pattern."""
125
+
126
+ ROUND_DOT = (3, "sysDot", "Line is made up of round dots.")
127
+ """Line is made up of round dots."""
128
+
129
+ SOLID = (1, "solid", "Line is solid.")
130
+ """Line is solid."""
131
+
132
+ SQUARE_DOT = (2, "sysDash", "Line is made up of square dots.")
133
+ """Line is made up of square dots."""
134
+
135
+ DASH_STYLE_MIXED = (-2, "", "Not supported.")
136
+ """Return value only, indicating more than one dash style applies."""
137
+
138
+
139
+ MSO_LINE = MSO_LINE_DASH_STYLE
140
+
141
+
142
+ class MSO_PATTERN_TYPE(BaseXmlEnum):
143
+ """Specifies the fill pattern used in a shape.
144
+
145
+ Alias: ``MSO_PATTERN``
146
+
147
+ Example::
148
+
149
+ from pptx.enum.dml import MSO_PATTERN
150
+
151
+ fill = shape.fill
152
+ fill.patterned()
153
+ fill.pattern = MSO_PATTERN.WAVE
154
+
155
+ MS API Name: `MsoPatternType`
156
+
157
+ https://learn.microsoft.com/en-us/office/vba/api/Office.MsoPatternType
158
+ """
159
+
160
+ CROSS = (51, "cross", "Cross")
161
+ """Cross"""
162
+
163
+ DARK_DOWNWARD_DIAGONAL = (15, "dkDnDiag", "Dark Downward Diagonal")
164
+ """Dark Downward Diagonal"""
165
+
166
+ DARK_HORIZONTAL = (13, "dkHorz", "Dark Horizontal")
167
+ """Dark Horizontal"""
168
+
169
+ DARK_UPWARD_DIAGONAL = (16, "dkUpDiag", "Dark Upward Diagonal")
170
+ """Dark Upward Diagonal"""
171
+
172
+ DARK_VERTICAL = (14, "dkVert", "Dark Vertical")
173
+ """Dark Vertical"""
174
+
175
+ DASHED_DOWNWARD_DIAGONAL = (28, "dashDnDiag", "Dashed Downward Diagonal")
176
+ """Dashed Downward Diagonal"""
177
+
178
+ DASHED_HORIZONTAL = (32, "dashHorz", "Dashed Horizontal")
179
+ """Dashed Horizontal"""
180
+
181
+ DASHED_UPWARD_DIAGONAL = (27, "dashUpDiag", "Dashed Upward Diagonal")
182
+ """Dashed Upward Diagonal"""
183
+
184
+ DASHED_VERTICAL = (31, "dashVert", "Dashed Vertical")
185
+ """Dashed Vertical"""
186
+
187
+ DIAGONAL_BRICK = (40, "diagBrick", "Diagonal Brick")
188
+ """Diagonal Brick"""
189
+
190
+ DIAGONAL_CROSS = (54, "diagCross", "Diagonal Cross")
191
+ """Diagonal Cross"""
192
+
193
+ DIVOT = (46, "divot", "Pattern Divot")
194
+ """Pattern Divot"""
195
+
196
+ DOTTED_DIAMOND = (24, "dotDmnd", "Dotted Diamond")
197
+ """Dotted Diamond"""
198
+
199
+ DOTTED_GRID = (45, "dotGrid", "Dotted Grid")
200
+ """Dotted Grid"""
201
+
202
+ DOWNWARD_DIAGONAL = (52, "dnDiag", "Downward Diagonal")
203
+ """Downward Diagonal"""
204
+
205
+ HORIZONTAL = (49, "horz", "Horizontal")
206
+ """Horizontal"""
207
+
208
+ HORIZONTAL_BRICK = (35, "horzBrick", "Horizontal Brick")
209
+ """Horizontal Brick"""
210
+
211
+ LARGE_CHECKER_BOARD = (36, "lgCheck", "Large Checker Board")
212
+ """Large Checker Board"""
213
+
214
+ LARGE_CONFETTI = (33, "lgConfetti", "Large Confetti")
215
+ """Large Confetti"""
216
+
217
+ LARGE_GRID = (34, "lgGrid", "Large Grid")
218
+ """Large Grid"""
219
+
220
+ LIGHT_DOWNWARD_DIAGONAL = (21, "ltDnDiag", "Light Downward Diagonal")
221
+ """Light Downward Diagonal"""
222
+
223
+ LIGHT_HORIZONTAL = (19, "ltHorz", "Light Horizontal")
224
+ """Light Horizontal"""
225
+
226
+ LIGHT_UPWARD_DIAGONAL = (22, "ltUpDiag", "Light Upward Diagonal")
227
+ """Light Upward Diagonal"""
228
+
229
+ LIGHT_VERTICAL = (20, "ltVert", "Light Vertical")
230
+ """Light Vertical"""
231
+
232
+ NARROW_HORIZONTAL = (30, "narHorz", "Narrow Horizontal")
233
+ """Narrow Horizontal"""
234
+
235
+ NARROW_VERTICAL = (29, "narVert", "Narrow Vertical")
236
+ """Narrow Vertical"""
237
+
238
+ OUTLINED_DIAMOND = (41, "openDmnd", "Outlined Diamond")
239
+ """Outlined Diamond"""
240
+
241
+ PERCENT_10 = (2, "pct10", "10% of the foreground color.")
242
+ """10% of the foreground color."""
243
+
244
+ PERCENT_20 = (3, "pct20", "20% of the foreground color.")
245
+ """20% of the foreground color."""
246
+
247
+ PERCENT_25 = (4, "pct25", "25% of the foreground color.")
248
+ """25% of the foreground color."""
249
+
250
+ PERCENT_30 = (5, "pct30", "30% of the foreground color.")
251
+ """30% of the foreground color."""
252
+
253
+ ERCENT_40 = (6, "pct40", "40% of the foreground color.")
254
+ """40% of the foreground color."""
255
+
256
+ PERCENT_5 = (1, "pct5", "5% of the foreground color.")
257
+ """5% of the foreground color."""
258
+
259
+ PERCENT_50 = (7, "pct50", "50% of the foreground color.")
260
+ """50% of the foreground color."""
261
+
262
+ PERCENT_60 = (8, "pct60", "60% of the foreground color.")
263
+ """60% of the foreground color."""
264
+
265
+ PERCENT_70 = (9, "pct70", "70% of the foreground color.")
266
+ """70% of the foreground color."""
267
+
268
+ PERCENT_75 = (10, "pct75", "75% of the foreground color.")
269
+ """75% of the foreground color."""
270
+
271
+ PERCENT_80 = (11, "pct80", "80% of the foreground color.")
272
+ """80% of the foreground color."""
273
+
274
+ PERCENT_90 = (12, "pct90", "90% of the foreground color.")
275
+ """90% of the foreground color."""
276
+
277
+ PLAID = (42, "plaid", "Plaid")
278
+ """Plaid"""
279
+
280
+ SHINGLE = (47, "shingle", "Shingle")
281
+ """Shingle"""
282
+
283
+ SMALL_CHECKER_BOARD = (17, "smCheck", "Small Checker Board")
284
+ """Small Checker Board"""
285
+
286
+ SMALL_CONFETTI = (37, "smConfetti", "Small Confetti")
287
+ """Small Confetti"""
288
+
289
+ SMALL_GRID = (23, "smGrid", "Small Grid")
290
+ """Small Grid"""
291
+
292
+ SOLID_DIAMOND = (39, "solidDmnd", "Solid Diamond")
293
+ """Solid Diamond"""
294
+
295
+ SPHERE = (43, "sphere", "Sphere")
296
+ """Sphere"""
297
+
298
+ TRELLIS = (18, "trellis", "Trellis")
299
+ """Trellis"""
300
+
301
+ UPWARD_DIAGONAL = (53, "upDiag", "Upward Diagonal")
302
+ """Upward Diagonal"""
303
+
304
+ VERTICAL = (50, "vert", "Vertical")
305
+ """Vertical"""
306
+
307
+ WAVE = (48, "wave", "Wave")
308
+ """Wave"""
309
+
310
+ WEAVE = (44, "weave", "Weave")
311
+ """Weave"""
312
+
313
+ WIDE_DOWNWARD_DIAGONAL = (25, "wdDnDiag", "Wide Downward Diagonal")
314
+ """Wide Downward Diagonal"""
315
+
316
+ WIDE_UPWARD_DIAGONAL = (26, "wdUpDiag", "Wide Upward Diagonal")
317
+ """Wide Upward Diagonal"""
318
+
319
+ ZIG_ZAG = (38, "zigZag", "Zig Zag")
320
+ """Zig Zag"""
321
+
322
+ MIXED = (-2, "", "Mixed pattern (read-only).")
323
+ """Mixed pattern (read-only)."""
324
+
325
+
326
+ MSO_PATTERN = MSO_PATTERN_TYPE
327
+
328
+
329
+ class MSO_THEME_COLOR_INDEX(BaseXmlEnum):
330
+ """An Office theme color, one of those shown in the color gallery on the formatting ribbon.
331
+
332
+ Alias: ``MSO_THEME_COLOR``
333
+
334
+ Example::
335
+
336
+ from pptx.enum.dml import MSO_THEME_COLOR
337
+
338
+ shape.fill.solid()
339
+ shape.fill.fore_color.theme_color = MSO_THEME_COLOR.ACCENT_1
340
+
341
+ MS API Name: `MsoThemeColorIndex`
342
+
343
+ http://msdn.microsoft.com/en-us/library/office/ff860782(v=office.15).aspx
344
+ """
345
+
346
+ NOT_THEME_COLOR = (0, "", "Indicates the color is not a theme color.")
347
+ """Indicates the color is not a theme color."""
348
+
349
+ ACCENT_1 = (5, "accent1", "Specifies the Accent 1 theme color.")
350
+ """Specifies the Accent 1 theme color."""
351
+
352
+ ACCENT_2 = (6, "accent2", "Specifies the Accent 2 theme color.")
353
+ """Specifies the Accent 2 theme color."""
354
+
355
+ ACCENT_3 = (7, "accent3", "Specifies the Accent 3 theme color.")
356
+ """Specifies the Accent 3 theme color."""
357
+
358
+ ACCENT_4 = (8, "accent4", "Specifies the Accent 4 theme color.")
359
+ """Specifies the Accent 4 theme color."""
360
+
361
+ ACCENT_5 = (9, "accent5", "Specifies the Accent 5 theme color.")
362
+ """Specifies the Accent 5 theme color."""
363
+
364
+ ACCENT_6 = (10, "accent6", "Specifies the Accent 6 theme color.")
365
+ """Specifies the Accent 6 theme color."""
366
+
367
+ BACKGROUND_1 = (14, "bg1", "Specifies the Background 1 theme color.")
368
+ """Specifies the Background 1 theme color."""
369
+
370
+ BACKGROUND_2 = (16, "bg2", "Specifies the Background 2 theme color.")
371
+ """Specifies the Background 2 theme color."""
372
+
373
+ DARK_1 = (1, "dk1", "Specifies the Dark 1 theme color.")
374
+ """Specifies the Dark 1 theme color."""
375
+
376
+ DARK_2 = (3, "dk2", "Specifies the Dark 2 theme color.")
377
+ """Specifies the Dark 2 theme color."""
378
+
379
+ FOLLOWED_HYPERLINK = (12, "folHlink", "Specifies the theme color for a clicked hyperlink.")
380
+ """Specifies the theme color for a clicked hyperlink."""
381
+
382
+ HYPERLINK = (11, "hlink", "Specifies the theme color for a hyperlink.")
383
+ """Specifies the theme color for a hyperlink."""
384
+
385
+ LIGHT_1 = (2, "lt1", "Specifies the Light 1 theme color.")
386
+ """Specifies the Light 1 theme color."""
387
+
388
+ LIGHT_2 = (4, "lt2", "Specifies the Light 2 theme color.")
389
+ """Specifies the Light 2 theme color."""
390
+
391
+ TEXT_1 = (13, "tx1", "Specifies the Text 1 theme color.")
392
+ """Specifies the Text 1 theme color."""
393
+
394
+ TEXT_2 = (15, "tx2", "Specifies the Text 2 theme color.")
395
+ """Specifies the Text 2 theme color."""
396
+
397
+ MIXED = (
398
+ -2,
399
+ "",
400
+ "Indicates multiple theme colors are used, such as in a group shape (read-only).",
401
+ )
402
+ """Indicates multiple theme colors are used, such as in a group shape (read-only)."""
403
+
404
+
405
+ MSO_THEME_COLOR = MSO_THEME_COLOR_INDEX