pptx-cli 1.0.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.
@@ -0,0 +1,505 @@
1
+ Metadata-Version: 2.4
2
+ Name: pptx-cli
3
+ Version: 1.0.0
4
+ Summary: Template-bound PowerPoint generation for enterprise decks
5
+ Author: Thomas Rohde
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Thomas Rohde
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ License-File: LICENSE
28
+ Keywords: cli,enterprise,openxml,powerpoint,pptx
29
+ Classifier: Development Status :: 3 - Alpha
30
+ Classifier: Environment :: Console
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Programming Language :: Python :: 3.12
35
+ Classifier: Topic :: Office/Business
36
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
37
+ Requires-Python: >=3.12
38
+ Requires-Dist: jsonschema>=4.23.0
39
+ Requires-Dist: lxml>=5.3.1
40
+ Requires-Dist: pydantic>=2.10.6
41
+ Requires-Dist: python-pptx>=1.0.2
42
+ Requires-Dist: pyyaml>=6.0.2
43
+ Requires-Dist: rich>=13.9.4
44
+ Requires-Dist: typer>=0.15.1
45
+ Description-Content-Type: text/markdown
46
+
47
+ # pptx
48
+
49
+ [![PyPI version](https://img.shields.io/badge/pypi-v1.0.0-blue.svg)](https://pypi.org/project/pptx-cli/)
50
+ [![Python](https://img.shields.io/badge/python-3.12%2B-blue.svg)](https://www.python.org/downloads/)
51
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
52
+
53
+ Template-bound PowerPoint generation for enterprise decks.
54
+
55
+ `pptx` turns a real `.pptx` template into a machine-readable manifest, then generates slides and decks **inside the original corporate design contract** instead of trying to approximate it from prompts.
56
+
57
+ If your organization cares about slide masters, locked branding, placeholder rules, layout fidelity, and CI validation, this is the tool.
58
+
59
+ The package is published to PyPI as [`pptx-cli`](https://pypi.org/project/pptx-cli/) and installs the `pptx` command.
60
+
61
+ ## Why `pptx` exists
62
+
63
+ Most AI slide generators fail where enterprise users care most:
64
+
65
+ - layouts drift from the official template
66
+ - placeholders get used inconsistently
67
+ - static branding moves or disappears
68
+ - theme styling gets recreated approximately instead of preserved exactly
69
+ - decks look plausible but are structurally wrong
70
+
71
+ `pptx` takes a different approach:
72
+
73
+ 1. **Initialize from a real template**
74
+ 2. **Extract a manifest of layouts, placeholders, assets, and rules**
75
+ 3. **Generate only within those approved boundaries**
76
+ 4. **Validate output before it reaches humans, CI, or customers**
77
+
78
+ The result is a CLI that behaves more like a compiler toolchain than a drawing tool.
79
+
80
+ ## Features
81
+
82
+ - Initialize a manifest package from a real enterprise `.pptx`
83
+ - Inspect layouts, placeholders, themes, assets, and compatibility warnings
84
+ - Build slides from approved layouts only
85
+ - Build full decks from JSON/YAML specs
86
+ - Preserve template-bound masters, themes, geometry, and protected elements
87
+ - Validate generated decks against manifest rules and template fingerprints
88
+ - Diff template versions to detect breaking changes
89
+ - Generate template-specific wrapper CLIs
90
+ - Expose an agent-first machine contract with:
91
+ - stable JSON response envelopes
92
+ - structured error codes
93
+ - documented exit codes
94
+ - a built-in `guide` command
95
+ - `--dry-run` support for mutating commands
96
+
97
+ ## Installation
98
+
99
+ ### With `uv` (recommended)
100
+
101
+ ```bash
102
+ uv tool install pptx-cli
103
+ ```
104
+
105
+ ### From the repository
106
+
107
+ ```bash
108
+ uv tool install git+https://github.com/ThomasRohde/pptx-cli.git
109
+ ```
110
+
111
+ ### From PyPI with pip
112
+
113
+ ```bash
114
+ pip install pptx-cli
115
+ ```
116
+
117
+ ### Verify installation
118
+
119
+ ```bash
120
+ pptx --version
121
+ pptx guide --format json
122
+ ```
123
+
124
+ ## Quick start
125
+
126
+ The repository includes a real sample template at `Template.pptx`. The examples below use that file and the layout IDs currently extracted from it.
127
+
128
+ Initialize a template package from an existing PowerPoint file:
129
+
130
+ ```bash
131
+ pptx init ./Template.pptx --out ./corp-template
132
+ ```
133
+
134
+ Inspect the extracted layouts:
135
+
136
+ ```bash
137
+ pptx layouts list --manifest ./corp-template
138
+ pptx layouts show title-only --manifest ./corp-template
139
+ pptx placeholders list 1-title-and-content --manifest ./corp-template
140
+ ```
141
+
142
+ Create a single slide:
143
+
144
+ ```bash
145
+ pptx slide create \
146
+ --manifest ./corp-template \
147
+ --layout title-only \
148
+ --set title="Enterprise AI Operating Model" \
149
+ --set subtitle="March 2026" \
150
+ --out ./out/operating-model-slide.pptx
151
+ ```
152
+
153
+ Build a full deck from a spec:
154
+
155
+ ```bash
156
+ pptx deck build \
157
+ --manifest ./corp-template \
158
+ --spec ./deck.yaml \
159
+ --out ./out/operating-model.pptx
160
+ ```
161
+
162
+ Validate the result:
163
+
164
+ ```bash
165
+ pptx validate \
166
+ --manifest ./corp-template \
167
+ --deck ./out/operating-model.pptx \
168
+ --strict
169
+ ```
170
+
171
+ Preview the write before touching the filesystem:
172
+
173
+ ```bash
174
+ pptx deck build \
175
+ --manifest ./corp-template \
176
+ --spec ./deck.yaml \
177
+ --out ./out/operating-model.pptx \
178
+ --dry-run
179
+ ```
180
+
181
+ ## Example deck spec
182
+
183
+ ```yaml
184
+ manifest: ./corp-template
185
+ metadata:
186
+ title: Enterprise AI Operating Model
187
+ author: Thomas Rohde
188
+ template_version: 1.2.0
189
+ slides:
190
+ - layout: title-only
191
+ content:
192
+ title: Enterprise AI Operating Model
193
+ subtitle: March 2026
194
+ - layout: 1-breaker-with-pattern
195
+ content:
196
+ title: Why this change
197
+ subtitle: Preserve, don’t imitate
198
+ - layout: 1-title-and-content
199
+ content:
200
+ title: Core idea
201
+ content_1: |
202
+ Preserve the template.
203
+ Generate inside its rules.
204
+ subtitle: Layouts and placeholders become machine-readable contracts.
205
+ ```
206
+
207
+ ## Core commands
208
+
209
+ ```text
210
+ pptx guide
211
+ pptx init
212
+ pptx doctor
213
+ pptx layouts list
214
+ pptx layouts show
215
+ pptx placeholders list
216
+ pptx theme show
217
+ pptx assets list
218
+ pptx slide create
219
+ pptx deck build
220
+ pptx validate
221
+ pptx manifest diff
222
+ pptx manifest schema
223
+ pptx completions generate
224
+ pptx wrapper generate
225
+ ```
226
+
227
+ ## Manifest package layout
228
+
229
+ A template initialization produces a package like this:
230
+
231
+ ```text
232
+ corp-template/
233
+ manifest.yaml
234
+ manifest.schema.json
235
+ annotations.yaml
236
+ assets/
237
+ images/
238
+ media/
239
+ embedded/
240
+ previews/
241
+ layouts/
242
+ fingerprints/
243
+ parts.json
244
+ reports/
245
+ init-report.json
246
+ ```
247
+
248
+ ### Key files
249
+
250
+ - `manifest.yaml` — extracted source-of-truth contract
251
+ - `manifest.schema.json` — schema for validation and tooling
252
+ - `annotations.yaml` — human-authored semantic annotations layered over extracted facts
253
+ - `reports/init-report.json` — warnings, unsupported features, and compatibility findings
254
+ - `fingerprints/parts.json` — structural fingerprints used for validation and diffing
255
+
256
+ ## Supported v1 content types
257
+
258
+ `pptx` supports these placeholder content types in v1:
259
+
260
+ - text
261
+ - image
262
+ - table
263
+ - chart
264
+ - markdown-to-text
265
+
266
+ ### Fidelity model
267
+
268
+ Guaranteed in scope:
269
+
270
+ - slide size and orientation
271
+ - master/layout relationships
272
+ - approved placeholder geometry
273
+ - protected static elements
274
+ - preserved theme references where supported
275
+ - deterministic content mapping into approved placeholders
276
+
277
+ Best-effort in v1:
278
+
279
+ - advanced chart workbook behavior
280
+ - highly custom chart or table styling internals
281
+ - content-sensitive text reflow edge cases
282
+ - animations and transitions
283
+
284
+ ## Agent-first CLI contract
285
+
286
+ `pptx` is designed to be scriptable by both humans and coding agents.
287
+
288
+ ### Structured response envelope
289
+
290
+ In machine-readable mode, commands return a single JSON envelope on stdout:
291
+
292
+ ```json
293
+ {
294
+ "schema_version": "1.0",
295
+ "request_id": "req_20260307_120000_abcd",
296
+ "ok": true,
297
+ "command": "layouts.list",
298
+ "result": {},
299
+ "warnings": [],
300
+ "errors": [],
301
+ "metrics": {
302
+ "duration_ms": 42
303
+ }
304
+ }
305
+ ```
306
+
307
+ ### Output rules
308
+
309
+ - stdout is reserved for structured machine output
310
+ - stderr is used for progress and diagnostics
311
+ - `LLM=true` enables minimal non-decorative output behavior
312
+ - `--dry-run` previews mutating commands without writing files
313
+
314
+ ### Discoverability
315
+
316
+ Use `guide` to retrieve the CLI contract in one call:
317
+
318
+ ```bash
319
+ pptx guide --format json
320
+ ```
321
+
322
+ That output includes:
323
+
324
+ - commands and subcommands
325
+ - input/output schema references
326
+ - examples
327
+ - error-code taxonomy
328
+ - exit-code mapping
329
+ - identifier conventions
330
+
331
+ ## Exit codes
332
+
333
+ `pptx` uses stable exit-code categories for automation:
334
+
335
+ | Exit code | Meaning |
336
+ |---|---|
337
+ | `0` | Success |
338
+ | `10` | Validation or schema error |
339
+ | `20` | Permission or policy failure |
340
+ | `40` | Conflict or stale-state failure |
341
+ | `50` | I/O or package read/write failure |
342
+ | `90` | Internal error |
343
+
344
+ ## Safety model
345
+
346
+ Mutating commands support preview-first workflows and safe writes:
347
+
348
+ - `--dry-run` for non-destructive previews
349
+ - structured change summaries for write operations
350
+ - explicit override flags for dangerous operations
351
+ - temporary-file staging and atomic replacement where possible
352
+
353
+ Because PowerPoint files are ZIP-based packages wearing office clothes, half the job is content generation and the other half is not breaking them.
354
+
355
+ ## Wrapper CLIs
356
+
357
+ You can generate a template-specific wrapper CLI for teams that want a narrower interface:
358
+
359
+ ```bash
360
+ pptx wrapper generate \
361
+ --manifest ./corp-template \
362
+ --out ./wrappers/acme-pptx
363
+ ```
364
+
365
+ In v1, wrapper generation emits a thin Python package scaffold that delegates to the shared `pptx` engine.
366
+
367
+ ## Validation and governance
368
+
369
+ `pptx validate` checks both structure and fidelity constraints, including:
370
+
371
+ - master/layout usage
372
+ - placeholder mapping correctness
373
+ - required placeholder presence
374
+ - schema compliance of deck specs
375
+ - missing assets or broken relationships
376
+ - fingerprint mismatches for protected components
377
+ - geometry drift for locked objects and placeholders
378
+
379
+ This makes `pptx` suitable for:
380
+
381
+ - local authoring workflows
382
+ - CI pipelines
383
+ - agent-driven deck generation
384
+ - enterprise template governance
385
+
386
+ ## Versioning and diffing
387
+
388
+ When templates change, `pptx` can compare manifest packages:
389
+
390
+ ```bash
391
+ pptx manifest diff ./corp-template-v1 ./corp-template-v2
392
+ ```
393
+
394
+ Diffs highlight:
395
+
396
+ - added or removed layouts
397
+ - placeholder contract changes
398
+ - alias changes
399
+ - geometry changes
400
+ - theme/font changes
401
+ - asset changes
402
+ - additive vs. breaking changes
403
+
404
+ ## Platform support
405
+
406
+ - Windows
407
+ - macOS
408
+ - Linux
409
+
410
+ Microsoft PowerPoint is **not required** to run the CLI.
411
+
412
+ ## Use cases
413
+
414
+ - enterprise strategy decks
415
+ - consulting deliverables
416
+ - board and steering-committee presentations
417
+ - corporate communications templates
418
+ - internal automation pipelines generating `.pptx` output from structured data
419
+ - AI-assisted deck generation with strict branding control
420
+
421
+ ## Development
422
+
423
+ ### Sample template for local testing
424
+
425
+ The repository root includes `Template.pptx`, which is currently used for:
426
+
427
+ - CLI integration tests
428
+ - README quick-start examples
429
+ - local manual smoke tests while the fixture catalog grows
430
+
431
+ If additional sanitized templates are introduced later, they should live under `tests/fixtures/templates/` with a short note describing their scenario coverage.
432
+
433
+ Clone the repository and sync the development environment:
434
+
435
+ ```bash
436
+ git clone https://github.com/ThomasRohde/pptx-cli.git
437
+ cd pptx-cli
438
+ uv sync --group dev
439
+ ```
440
+
441
+ Run the test suite:
442
+
443
+ ```bash
444
+ uv run pytest
445
+ ```
446
+
447
+ Run linting and type checks:
448
+
449
+ ```bash
450
+ uv run ruff check .
451
+ uv run ruff format --check .
452
+ uv run pyright
453
+ ```
454
+
455
+ ## Versioning
456
+
457
+ The project uses semantic versioning with a **single source of truth** in `src/pptx_cli/__init__.py`.
458
+
459
+ Use the helper script to bump versions safely:
460
+
461
+ ```bash
462
+ uv run python scripts/bump_version.py patch
463
+ uv run python scripts/bump_version.py minor
464
+ uv run python scripts/bump_version.py major
465
+ ```
466
+
467
+ This commits the version change, creates an annotated `v*` tag, and pushes — which triggers the publish workflow automatically. Use `--no-push` to tag locally without pushing.
468
+
469
+ This updates the package version used for builds and PyPI publishing without needing to edit multiple files manually.
470
+
471
+ ## Documentation
472
+
473
+ - `PRD.md` — product definition and scope
474
+ - `CLI-MANIFEST.md` — agent-first CLI design principles adopted by this project
475
+ - `SCAFFOLD.md` — project scaffolding instructions
476
+
477
+ ## Roadmap highlights
478
+
479
+ - richer preview generation
480
+ - deeper table/chart plugins
481
+ - broader enterprise policy packs
482
+ - multi-template registries
483
+ - post-v1 MCP integration
484
+
485
+ ## Contributing
486
+
487
+ Contributions are welcome.
488
+
489
+ Please open an issue or discussion for:
490
+
491
+ - new placeholder/content type support
492
+ - template edge cases
493
+ - manifest schema changes
494
+ - CLI contract changes
495
+ - validation or fidelity bugs
496
+
497
+ For larger changes, include:
498
+
499
+ - the motivating template behavior
500
+ - expected vs. actual output
501
+ - sample manifest or sanitized `.pptx` structure where possible
502
+
503
+ ## License
504
+
505
+ MIT
@@ -0,0 +1,28 @@
1
+ pptx_cli/__init__.py,sha256=zHV2M6IAifaZLSjMwl38Lnsdp1e9BLkmZU8cXrLdnXM,74
2
+ pptx_cli/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
3
+ pptx_cli/cli.py,sha256=VBDuTGyhn_EvLwsCB5Fb2XO0pRPkfks6GhImisjvnbo,11663
4
+ pptx_cli/commands/__init__.py,sha256=gQ6tnU0Rvm0-ESWFUBU-KDl5dpNOpUTG509hXOQQjwY,27
5
+ pptx_cli/commands/compose.py,sha256=M40r1KAgN5m7lifgjZAZuhJBwhHpE-PmWjRYIXHa-n8,1996
6
+ pptx_cli/commands/guide.py,sha256=lNLcKvPLHKFLzKExqwZsgxhybu4sWUDLbVAYnw_dNRk,6666
7
+ pptx_cli/commands/init.py,sha256=iWWhzvKRdHrqa7ZPGSbx8OPsiOX0RPor57OrbhJIPgg,1501
8
+ pptx_cli/commands/inspect.py,sha256=44QPISE8bJORX_SfxejglQdaXpChWEpblTG26ywVK98,2752
9
+ pptx_cli/commands/manifest_ops.py,sha256=h8IFJkWt70-U-tWyEdxhJ3pLorTSDAakO_umoZJOPzI,643
10
+ pptx_cli/commands/validate.py,sha256=tvbtXbEWc90HkaNT3lels5xVawd2QWX4YyqUglv3Dc8,449
11
+ pptx_cli/commands/wrapper.py,sha256=MFrEijPhWcjees6QZ0yRvV_TorDG89F-F_fnDarhz78,7548
12
+ pptx_cli/core/__init__.py,sha256=ehOnz_7yfZMv4k5gNtY2IxJt3C-MXmgIIQxtIwCXpXU,28
13
+ pptx_cli/core/composition.py,sha256=xEEPy94Gr1jA8sqaLJOzeOZMxxu8XuQ7Xn9xuubXWEE,10266
14
+ pptx_cli/core/ids.py,sha256=FlLiP3TDXL2iH-P2sHkM8bObluG_EnuBFnOWfdgcFAw,547
15
+ pptx_cli/core/io.py,sha256=3QrTqdJQH0RnWTyGLPXmB_iHijqLc-RpjlAyNtA9ewk,1670
16
+ pptx_cli/core/manifest_store.py,sha256=f0VjSlSLAfYYSiSEYopX7MxQ4RQV47h0OsMdjxAafRA,2011
17
+ pptx_cli/core/runtime.py,sha256=EXEyC3efWNMasEuDllsFcmzIMVcPyjkY1YVP9ctr9aU,644
18
+ pptx_cli/core/template.py,sha256=ha4dQJqDrt0UOSHaiLagCm51vjNoco0mctfUTFgsIFo,22102
19
+ pptx_cli/core/validation.py,sha256=nrXB9pyBe4QDc24cODaTIyI2qoKrom52oU4KnlSNNcU,8293
20
+ pptx_cli/core/versioning.py,sha256=R4Wk4m4K0gPfQIa-OOSM6EHVqkAXLKasQ92hrv-CRFU,1565
21
+ pptx_cli/models/__init__.py,sha256=w3uwhzxinzrafGS8x0OhfWDCBerckShkGhuFl-_wEzI,38
22
+ pptx_cli/models/envelope.py,sha256=fgNiINoOd_Jjt7qbzB9pNrwN5HCgSTr-e6zTk_ZVfXg,1399
23
+ pptx_cli/models/manifest.py,sha256=rqylSMPgW0q_ESM_audoBnU2wb3pl7OyohmGnesdxG4,4902
24
+ pptx_cli-1.0.0.dist-info/METADATA,sha256=mT31KwMQfNd6F-ojuVXZvzMB5itLuhXdySemEwYNP1A,13403
25
+ pptx_cli-1.0.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
+ pptx_cli-1.0.0.dist-info/entry_points.txt,sha256=KCwbqLMg3lFy-ixO3MYv0Xv4buWwPAc7W3cFusk6jXs,43
27
+ pptx_cli-1.0.0.dist-info/licenses/LICENSE,sha256=XeaSn5y2iyNPWLW7TlPEWT8OkLhuZw-koqZ5bhUw5tg,1069
28
+ pptx_cli-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pptx = pptx_cli.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Thomas Rohde
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.