Translate PowerPoint presentations using modern LLM providers with vision-based review
Project description
PPT Translator
Convert your PowerPoint presentations to beautifully translated documents while preserving formatting
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
.envfile automatically when run from a shell session that has the variables exported. On macOS you can add the exports to~/.zshrcor usedirenvfor 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:
{deck}_original.xmlโ source deck contents.{deck}_translated.xmlโ translated content.{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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5eb4b781f83adbfbce89cacb136873bea9f4fd95401b442db4e5944d97b1f09
|
|
| MD5 |
49862269c837d9d33d511266206f8997
|
|
| BLAKE2b-256 |
65f2b86eb83653cef6ca5f2f37e0db806cbf1bccd6447cfcf17331bfe48ce017
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07433b23ec3a26a807b3b55c5fbac806681c685ce70e9e2b7fb3c669e93c6c8b
|
|
| MD5 |
4713cf5f2ee57956ea3beafb7324d426
|
|
| BLAKE2b-256 |
5c457121493d9b28639dc72ce23c267ab0fa32f36f566578141de19122484fe8
|