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.0a3-py3-none-win_amd64.whl (7.4 MB view details)

Uploaded Python 3Windows x86-64

gopptx-0.2.0a3-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.0a3-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.0a3-py3-none-win_amd64.whl.

File metadata

  • Download URL: gopptx-0.2.0a3-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.0a3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a152445553849a0b3980c263b9a261140dcc11308a1cf8bbc98a5b74449b7cdf
MD5 deef042d45152373f85d032b47d5d599
BLAKE2b-256 dcb26782bbdbfce140aa7add2d60235555cc30c54ba82b446e84b7aa30b28f88

See more details on using hashes here.

File details

Details for the file gopptx-0.2.0a3-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.0a3-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 1a3609ed807bee7e5104c6bb2c14bf96a1dc365001b64b74208ca69928af1aaa
MD5 7e874456b9910c1c00fa01a3f5722688
BLAKE2b-256 6a934a0c86b833e542da9112e9bf07e21cc74d8b7ee822186e98c12e6d954b63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gopptx-0.2.0a3-py3-none-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 a57cad9256fb3e3b728367b04eac1924d8e39ad4f15112a49872c53bdd2a08da
MD5 7fb520295e96acc80a61c12c096119ea
BLAKE2b-256 3355ec1233aa0973af12c36cd44984866e55b07a9009ebd4358361e727eea947

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