High-performance PPTX engine powered by Go
Project description
gopptx
PowerPoint (PPTX) engine written in Go — with a Python library and a stable JSON command bridge for cross-language use.
Overview
gopptx is a Go library for generating and manipulating PPTX files. It is designed for correctness and ease of use across languages. A stable JSON command bridge lets you drive it from Python, or any other language without rewriting logic.
Why gopptx?
gopptx combines the native performance of Go with cross-language accessibility, making it ideal for high-throughput presentation generation. Use it for automating business reports, creating dynamic slides from data sources, or integrating PPTX creation into your existing workflows without sacrificing speed or reliability.
Key Capabilities
| Feature | Description |
|---|---|
| Rich Diagrams | Native Mermaid rendering (12+ types) and SmartArt |
| Deep Editing | Full control over shapes, images, charts, tables, and text |
| Themes & Layouts | Built-in themes, color schemes, font schemes, and layout helpers |
| Accessibility | Alt-text, sections, comments, and speaker notes |
| Export | PDF export (native, LibreOffice, or PowerPoint driver) |
| Cross-Language | Stable JSON command API for Python and other language interop |
Prerequisites
- Go: 1.25.9 or later
- Python: 3.10 or later (required for Python bindings)
- Platforms: Windows, Linux, macOS
Installation
Go
go get github.com/djinn-soul/gopptx
Python
The Python package uses a high-performance Go shared library for PPTX processing. You need to build this library before installing the package.
-
Build the Go shared library:
- Windows (PowerShell):
.\scripts\build_python.ps1
- Linux/macOS (Bash):
./scripts/build_python.sh
- Windows (PowerShell):
-
Install the Python package:
pip install -e .
Quick Start
Python Setup
Build the native bridge and install the package locally:
# Windows
.\scripts\build_python.ps1
pip install -e .
# Linux/macOS
./scripts/build_python.sh
pip install -e .
Python
Create and save a new deck:
from gopptx import Presentation
with Presentation.new("Quarterly Update") as pres:
pres.add_slide("Overview")
pres.add_bullet_slide("Highlights", ["Growth +12%", "Retention +4%"])
pres.save("output.pptx")
Open and edit an existing deck:
from gopptx import Presentation
with Presentation("input.pptx") as pres:
pres.set_slide_title(0, "Updated Title")
pres.add_slide("New Closing Slide")
pres.save("edited.pptx")
Run many writes in one batch:
from gopptx import Presentation
with Presentation.new("Batch Demo") as pres:
with pres.batch(stop_on_error=True) as batch:
for i in range(100):
batch.add_slide(f"Slide {i}")
pres.save("batch.pptx")
Go
Install and run:
go get github.com/djinn-soul/gopptx
go run ./your-main.go
package main
import (
"os"
"github.com/djinn-soul/gopptx/pkg/pptx"
)
func main() {
slides := []pptx.SlideContent{
pptx.NewSlide("Hello from gopptx").AddBullet("Created with gopptx"),
}
data, err := pptx.CreateWithSlides("My Deck", slides)
if err != nil {
panic(err)
}
if err := os.WriteFile("output.pptx", data, 0o600); err != nil {
panic(err)
}
}
Next Docs
- Python API reference: docs/reference/python-presentation-api.md
- Go API reference: docs/reference/go-api.md
- Full quickstart page: docs/quickstart.md
- Runnable examples: examples/README.md
PDF Export
PDF export supports three drivers: native, libreoffice, and powerpoint. The default auto mode tries LibreOffice or PowerPoint first, and falls back to the native renderer.
Note: The native Go PDF renderer is experimental. It may differ from PowerPoint output for advanced SmartArt or layout-heavy decks. Use
autofor production unless you specifically need the native renderer.
Example (Python):
from gopptx import Presentation
with Presentation("input.pptx") as pres:
pres.export_pdf("output.pdf", driver="auto")
Driver requirements (Windows):
powerpoint— requires Microsoft PowerPoint installed (COM automation) and PowerShell (powershellorpwsh).libreoffice— requires LibreOffice withsofficeonPATH. Ifsofficeis not recognized, addC:\Program Files\LibreOffice\programto yourPATH.
Documentation
| Resource | Description |
|---|---|
| Quickstart | Python and Go quickstart examples |
| Examples Index | 90+ runnable examples covering all features |
| Python Guide | Full Python API reference and usage |
| Go API Reference | Go library reference |
| Bridge Operations | All 149 JSON bridge commands |
| Showcase | Real-world usage patterns (simple → complex) |
Contributing
See CONTRIBUTING.md for setup instructions, code guidelines, and the PR checklist.
License
Apache License 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gopptx-0.2.0a4-py3-none-win_amd64.whl.
File metadata
- Download URL: gopptx-0.2.0a4-py3-none-win_amd64.whl
- Upload date:
- Size: 7.4 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8157a65e23fbe9de035f74c0877874b90d679d5d0b1d81f5f5b416047b10499
|
|
| MD5 |
a02e28a93af149b113a6b3e6138d2c9c
|
|
| BLAKE2b-256 |
fe39eb5126dd9bf1a5fd7814b5ac6463125316ecea07f7f42980c69fc50ad1db
|
File details
Details for the file gopptx-0.2.0a4-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: gopptx-0.2.0a4-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 7.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e6390c4d94489f3287b5384bb3ae8a09c2c75941c5bee72b5673cea3a927e7d
|
|
| MD5 |
12f3b2590f7458ad36f4450ac988f7d5
|
|
| BLAKE2b-256 |
e6864bc0a31796f5cb79e4a045bf7caa1ffef19db37af9ee22b38dec96a8967a
|
File details
Details for the file gopptx-0.2.0a4-py3-none-macosx_10_13_universal2.whl.
File metadata
- Download URL: gopptx-0.2.0a4-py3-none-macosx_10_13_universal2.whl
- Upload date:
- Size: 6.7 MB
- Tags: Python 3, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c37cae109921595903b0bef4ce9161902b135a64b34c42380ff249624d6d8b5
|
|
| MD5 |
07dbdd1827cc71e6af015cf13109c5b8
|
|
| BLAKE2b-256 |
076938fdfe3c9240fa36a7535b4d86b35e0d81ab07370bbeb33a7c61a5ed46d8
|