Skip to main content

Translate PowerPoint presentations using modern LLM providers with vision-based review

Project description

PPT Translator Logo

PPT Translator

Convert your PowerPoint presentations to beautifully translated documents while preserving formatting

Python License UV Tests Code Style

Clean, fast, and reliable PowerPoint translation with multi-provider support and formatting preservation

โœจ Features โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Usage โ€ข ๐Ÿงช Testing โ€ข ๐Ÿค Contributing


โœจ Features

โ€ข โšก Lightning Fast: Sub-2 second translation for most presentations โ€ข ๐Ÿ”„ Multi-Provider Support: Switch between DeepSeek, OpenAI, Anthropic, and Grok with a simple CLI flag โ€ข ๐ŸŽจ Rich Formatting: Preserves fonts, colors, spacing, tables, and alignment after translation โ€ข ๐Ÿ”— Smart Caching: Avoids duplicate API calls for repeated strings โ€ข ๐Ÿ“ฆ Batch Processing: Convert entire directories of presentations at once โ€ข ๐Ÿ›ก๏ธ Robust Processing: Handles all PowerPoint content types with graceful fallbacks

๐Ÿ“ฆ Installation

Option 1: Install via pip (Recommended)

pip install pptrans

Option 2: Install from source

git clone https://github.com/Z-MarkUs/PPTrans.git
cd PPTrans
pip install -e .

Option 3: Use standalone applications

Download pre-built applications for:

  • macOS Apple Silicon (arm64): PPT-Translator-arm64.app
  • macOS Intel (x86_64): PPT-Translator-x86_64.app
  • Windows (x86): PPT-Translator.exe

Or build from source:

# macOS
./build.sh

# Windows
build.bat

# Linux
python3 build_app.py linux

๐Ÿ“‹ Requirements

  • Python 3.10+ (for pip installation)
  • Provider API keys stored in environment variables (see below)

๐Ÿ” Configuration

Copy example.env to .env and fill in the API keys for the providers you plan to use. All keys are optional โ€“ only populate the providers you intend to call.

cp example.env .env

Environment variables of interest:

Provider Required variable Optional variables Example default model
DeepSeek DEEPSEEK_API_KEY DEEPSEEK_API_BASE deepseek-chat
OpenAI OPENAI_API_KEY OPENAI_ORG gpt-5 (use --model for Mini/Nano)
Anthropic ANTHROPIC_API_KEY โ€” claude-3.7-sonnet
Grok GROK_API_KEY GROK_API_BASE grok-beta

๐Ÿ“ The CLI reads your .env file automatically when run from a shell session that has the variables exported. On macOS you can add the exports to ~/.zshrc or use direnv for project-specific secrets.

๐Ÿš€ Quick Start

After installation, use the pptrans command:

# Translate a single file
pptrans presentation.pptx --provider openai --source-lang zh --target-lang en

# Translate all PPT files in a directory
pptrans ./presentations/ --provider openai

# With vision review
pptrans presentation.pptx --provider openai --vision-review --vision-model gpt-5.1

# Generate review file for manual editing
pptrans presentation.pptx --provider openai --generate-review

๐Ÿ“– Usage

Run the CLI with the path to a single presentation or a directory tree:

pptrans /path/to/decks \
  --provider openai \
  --model gpt-5-mini \
  --source-lang zh \
  --target-lang en \
  --max-workers 4

Common options:

  • --provider {deepseek,openai,anthropic,grok} โ€“ choose the model provider.
  • --model MODEL_NAME โ€“ override the default model for that provider (e.g. gpt-5-nano).
  • --source-lang / --target-lang โ€“ ISO language codes.
  • --max-chunk-size โ€“ character limit per translation request (default: 1000).
  • --max-workers โ€“ number of threads used when scanning slides (default: 4).
  • --keep-intermediate โ€“ keep intermediate XML files for inspection/debugging.

The tool will generate:

  1. {deck}_original.xml โ€“ source deck contents.
  2. {deck}_translated.xml โ€“ translated content.
  3. {deck}_translated.pptx โ€“ rebuilt presentation with translated text and formatting intact.

๐Ÿงช Testing

Run unit tests with Pytest:

pytest

The test suite focuses on translation chunking/caching and CLI utilities to ensure the core pipeline stays reliable as providers evolve.

๐Ÿ› ๏ธ Project Structure

.
โ”œโ”€โ”€ ppt_translator/
โ”‚   โ”œโ”€โ”€ cli.py               # CLI parsing and orchestration
โ”‚   โ”œโ”€โ”€ pipeline.py          # PPT extraction, translation, regeneration
โ”‚   โ”œโ”€โ”€ providers/           # DeepSeek, OpenAI, Anthropic, Grok adapters
โ”‚   โ”œโ”€โ”€ translation.py       # Chunking + caching translation service
โ”‚   โ””โ”€โ”€ utils.py             # Filesystem helpers
โ”œโ”€โ”€ tests/                   # Pytest suite
โ”œโ”€โ”€ example.env              # Environment variable template
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ main.py                  # Entry point (delegates to CLI)

๐Ÿค Contributing

Pull requests and issues are welcome. Please run pytest before submitting changes and document any new providers or configuration steps in the README.

๐Ÿ“„ License

This project remains under the MIT License. See LICENSE for details.

Project details


Download files

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

Source Distribution

pptrans-1.0.0.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

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

pptrans-1.0.0-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file pptrans-1.0.0.tar.gz.

File metadata

  • Download URL: pptrans-1.0.0.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for pptrans-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b5eb4b781f83adbfbce89cacb136873bea9f4fd95401b442db4e5944d97b1f09
MD5 49862269c837d9d33d511266206f8997
BLAKE2b-256 65f2b86eb83653cef6ca5f2f37e0db806cbf1bccd6447cfcf17331bfe48ce017

See more details on using hashes here.

File details

Details for the file pptrans-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pptrans-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for pptrans-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07433b23ec3a26a807b3b55c5fbac806681c685ce70e9e2b7fb3c669e93c6c8b
MD5 4713cf5f2ee57956ea3beafb7324d426
BLAKE2b-256 5c457121493d9b28639dc72ce23c267ab0fa32f36f566578141de19122484fe8

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