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

Uploaded Python 3Windows x86-64

gopptx-0.2.0a4-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.0a4-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.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

Hashes for gopptx-0.2.0a4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a8157a65e23fbe9de035f74c0877874b90d679d5d0b1d81f5f5b416047b10499
MD5 a02e28a93af149b113a6b3e6138d2c9c
BLAKE2b-256 fe39eb5126dd9bf1a5fd7814b5ac6463125316ecea07f7f42980c69fc50ad1db

See more details on using hashes here.

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

File hashes

Hashes for gopptx-0.2.0a4-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8e6390c4d94489f3287b5384bb3ae8a09c2c75941c5bee72b5673cea3a927e7d
MD5 12f3b2590f7458ad36f4450ac988f7d5
BLAKE2b-256 e6864bc0a31796f5cb79e4a045bf7caa1ffef19db37af9ee22b38dec96a8967a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gopptx-0.2.0a4-py3-none-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 7c37cae109921595903b0bef4ce9161902b135a64b34c42380ff249624d6d8b5
MD5 07dbdd1827cc71e6af015cf13109c5b8
BLAKE2b-256 076938fdfe3c9240fa36a7535b4d86b35e0d81ab07370bbeb33a7c61a5ed46d8

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