Skip to main content

High-performance PPTX engine powered by Go

Project description

gopptx

License: Apache 2.0

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.

  1. Build the Go shared library:

    • Windows (PowerShell):
      .\scripts\build_python.ps1
      
    • Linux/macOS (Bash):
      ./scripts/build_python.sh
      
  2. 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


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 auto for 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 (powershell or pwsh).
  • libreoffice — requires LibreOffice with soffice on PATH. If soffice is not recognized, add C:\Program Files\LibreOffice\program to your PATH.

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

gopptx-0.2.0a2-py3-none-win_amd64.whl (7.4 MB view details)

Uploaded Python 3Windows x86-64

gopptx-0.2.0a2-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (7.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gopptx-0.2.0a2-py3-none-macosx_10_13_universal2.whl (6.7 MB view details)

Uploaded Python 3macOS 10.13+ universal2 (ARM64, x86-64)

File details

Details for the file gopptx-0.2.0a2-py3-none-win_amd64.whl.

File metadata

  • Download URL: gopptx-0.2.0a2-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

Hashes for gopptx-0.2.0a2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f5a0b49eb0bfd981c005fb93ffb65653010b47c9d003280f411e5e06c8c7ddfd
MD5 bbc399cea55dda00a8e76b3cd4570d3a
BLAKE2b-256 ba515fc53dd27bcbbd7742f9ac4883450c1dfa9e2b6ede57a30e8f48c66192c2

See more details on using hashes here.

File details

Details for the file gopptx-0.2.0a2-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for gopptx-0.2.0a2-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 d11011c0859a3254e3341a48ed342592ace4a324f09bc47763f5c90469ef6496
MD5 3327dfeebe5766a8793fe365df5afb5e
BLAKE2b-256 2f92b8919e6d0c0b2877347285ce501690da74990259393e1a963a15ac66dd21

See more details on using hashes here.

File details

Details for the file gopptx-0.2.0a2-py3-none-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for gopptx-0.2.0a2-py3-none-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 f8d415852a7a69c92d9f13ea5459525e1b94a9dc165676b0e7dc188e37d079a9
MD5 aee0a83295e0083598dd45a16dbc9774
BLAKE2b-256 e9e0aeb559dc5e025cefa5868a6a32820a379cd8a7af3ce108ed31a9ada8412b

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