Skip to main content

Generate beautiful PowerPoint decks programmatically with native 3D models, cinematic transitions, and themed layouts.

Project description

pptxforge

Generate beautiful PowerPoint decks programmatically — with native 3D models, cinematic transitions, and themed layouts.

PyPI version Python versions License: MIT CI

Hero

Why pptxforge?

Most Python tools for PowerPoint focus on filling in templates. pptxforge focuses on producing beautiful decks: 10 themed designs, native embedded 3D models that PowerPoint can morph between, four cinematic transition helpers, and content-aware visual primitives that make slides look hand-designed.

Themed primitives that stay aligned Repulsion-based label scales Cinematic morph helpers
CardGrid + StatRow LabeledScale Cinematic helpers cover

Install

pip install pptxforge

Python 3.10 or later. Generated .pptx files open in PowerPoint Desktop, PowerPoint Online, Keynote, and LibreOffice Impress.

Quickstart

from pptxforge import Card, CardGrid, Deck, themes

deck = Deck(theme=themes.MIDNIGHT_EXECUTIVE, title="Hello, world")

deck.add_title_slide(
    title="Hello, pptxforge",
    subtitle="Your first deck in six lines of Python",
)

deck.add_content_slide(
    title="Three things pptxforge does",
    layout=CardGrid(
        [
            Card(number="1", title="Themes", body="10 production themes, light and dark."),
            Card(number="2", title="Native 3D", body="Embed GLB models PowerPoint can morph between."),
            Card(number="3", title="Cinematic", body="Zoom, pan, reveal, and shape-transform helpers."),
        ],
        columns=3,
    ),
)

deck.save("hello-world/")

That's it. You now have hello-world/deck.pptx. Open it in PowerPoint.

A complete runnable version lives in examples/hello_world/build.py.

Features

  • 10 themes — Pacific Deep, Midnight Executive, Forest Moss, Coral Energy, Slate Minimalist, Royal Plum, Monochrome Ink, Amber Editorial, Sunrise Citrus, Berry Bold.
  • Native 3D models — embed GLB files, with auto-fit cameras and morph between camera angles using PowerPoint's native morph engine.
  • Cinematic transitionscinematic_zoom, prezi_canvas, number_reveal, shape_transform, plus model3d_flight for multi-waypoint camera tours.
  • Visual primitivesLabeledScale (with collision-avoiding labels), CardGrid, Callout, StatRow.
  • Image fetchingfetch_image("modern coffee shop") works zero-config via Wikimedia Commons; Unsplash and Pexels supported with optional API keys.
  • Layout-variation validator — catches three-in-a-row identical layouts and other anti-patterns at build time.
  • 3D annotationsModelAnnotation with auto-projected leader lines that point at the right pixel from any camera angle.

Examples

The examples/ directory has runnable scripts demonstrating each feature:

Example What it shows
hello_world/build.py Minimal deck, no external assets
cinematic/build.py All four cinematic helpers in one deck
cinematic_flight/build.py 5-waypoint helmet camera tour
transitions/build.py Every transition type
fetch_image_quickstart.py Zero-config image fetching via Wikimedia
citrem_mayonnaise/build.py Full real-world demo with 3D molecules

Run any of them from the repo root:

python examples/hello_world/build.py

Image fetching

pptxforge.images.fetch_image("Eiffel Tower") works on first install — Wikimedia Commons is the zero-config default (no key, no signup, public-domain catalogue). For higher-quality photography:

from pptxforge.images import setup_wizard
setup_wizard("unsplash")   # opens browser, prompts for the key, takes ~3 minutes

fetch_image reads keys from the env first, then from the config file the wizard writes (%APPDATA%\pptxforge\config.toml on Windows / ~/.config/pptxforge/config.toml on POSIX). With any key set, source="auto" automatically prefers the paid source over Wikimedia.

Documentation

  • SKILL.md — comprehensive usage guide with the decision tree for picking primitives. Originally written for AI coding agents; useful for humans too.
  • ARCHITECTURE.md — public-API contract, module layout, data flow, extension points.
  • DECISIONS.md — dated log of non-obvious technical choices and tradeoffs.

How it works

pptxforge wraps python-pptx with a higher-level API focused on visual quality. It generates standard .pptx files that any major presentation tool can open.

3D models are embedded as native PowerPoint 3D objects (not images). Morph transitions between 3D slides use PowerPoint's native morph engine, with shape pairing keyed by a16:creationId so the model interpolates smoothly across waypoints. Image fetching uses the Wikimedia Commons API by default; Unsplash and Pexels are supported with optional API keys.

Limitations

  • PowerPoint Online and LibreOffice Impress render PowerPoint's native 3D differently than Desktop — Desktop is the gold target.
  • Some PowerPoint features (notably easing on transitions) aren't exposed because the OOXML spec doesn't expose them.
  • The library focuses on programmatic generation; it isn't an editor.
  • Speaker notes are supported (notes= on every add_*_slide) but not generated automatically.

Contributing

Issues and pull requests welcome at github.com/GA16-24/pptxforge.

To set up a development checkout:

git clone https://github.com/GA16-24/pptxforge
cd pptxforge
python -m pip install -e '.[dev]'

# All four CI gates:
ruff check src tests
ruff format --check src tests
mypy
pytest -n auto

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pptxforge-0.1.1.tar.gz (171.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pptxforge-0.1.1-py3-none-any.whl (208.2 kB view details)

Uploaded Python 3

File details

Details for the file pptxforge-0.1.1.tar.gz.

File metadata

  • Download URL: pptxforge-0.1.1.tar.gz
  • Upload date:
  • Size: 171.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pptxforge-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b7455c2a56e7a382b65712a72258b3f1cc7673c6afce707c4b9094ad8ba52cdf
MD5 2ec45761ebbae27f27141d56ecf7ba1c
BLAKE2b-256 fccdd272c3fcab4899eb62fa20b04f6ea6fed0fe17d704f817d0658b74e68e05

See more details on using hashes here.

File details

Details for the file pptxforge-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pptxforge-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 208.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pptxforge-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5340c728245d6324c44b0269c4a2f51385799d6a8cd98662e423b53e1d447fc8
MD5 56ce919d349a32a27bb9a4ef2ba5ce64
BLAKE2b-256 2dc26912168efbcc89bc2563aa3ff18c738309e12826395b04929447cc7f3d2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page