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

Uploaded Python 3Windows x86-64

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

File metadata

  • Download URL: gopptx-0.2.0a1-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.0a1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e6b8ce3643cdab0f8e34da0dbd78b499788c27536ae62e5f52cf025a8bd44094
MD5 9778c8f86cc1ddae339a1425f9b84bf0
BLAKE2b-256 fd0f20885c269d290f27afe5930d824ca90cd8449c84d2e6b2b06e6e04f3a71b

See more details on using hashes here.

File details

Details for the file gopptx-0.2.0a1-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.0a1-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 7396ea5f3197d9d32ef77b404dfa6dc26768ceeacd243dbfa87ab87259ace8fd
MD5 aadbe7b411c25996bec8c977dc504527
BLAKE2b-256 f7876a26aa66678f67fc66da8407bd07cfe1cd82ab6a1180ed08d2c08477f4c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gopptx-0.2.0a1-py3-none-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 22ee5b7b7cafb4944edb85226cd39b2bda8e7d567b7f092a32519d438c563d65
MD5 8fc09228bb46b398a479d8f4ebee9293
BLAKE2b-256 914aa451d3520510cd6bc5a0fcc8e93c7c635938fc9a8fd67622fbb1d2ea3a35

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