Skip to main content

Add your description here

Project description

InstaPPT

InstaPPT is an AI-powered PowerPoint translation tool designed to preserve the original visual fidelity of your slides while providing high-quality translations.

InstaPPT UI

Demo

Here is a visual comparison of the original and translated slides:

Visual Comparison

View full comparison PDF

Features

  • AI Translation: Uses advanced LLMs (like GPT-4, DeepSeek) for accurate, context-aware translation.
  • Visual Fidelity: Preserves fonts, colors, sizes, and layout.
  • Visual Comparison Report: Generates a side-by-side PDF report showing the original and translated slides as images, ensuring "what you see is what you get".
  • Smart Caching: Caches translation results to save costs and time on repeated runs.
  • Cross-Platform: Works on macOS (optimized) and Windows.

Architecture

graph TD
    User([User]) -->|Input| Interface
    
    subgraph Interface ["User Interface"]
        CLI["Command Line"]
        UI["Web UI (Gradio)"]
    end
    
    Interface --> Controller["Core Controller"]
    
    subgraph Pipeline ["Processing Pipeline"]
        Parser["PPTX Parser"] -->|Extract Text| Segments["Text Segments"]
        
        subgraph Translation ["LLM Translation Loop"]
            Step1[Translation] --> Step2[Evaluation]
            Step2 -- "Low Score" --> Step3[Optimization]
            Step2 -- "High Score" --> Ready[Ready]
            Step3 --> Ready
        end
        
        Segments -->|Parallel Processing| Translation
        Translation <-->|API Calls| LLM[("LLM Provider")]
        
        Ready --> Assembler["PPTX Assembler"]
        Assembler -->|Generate| Artifacts
    end
    
    Controller --> Pipeline
    
    subgraph Artifacts ["Output Files"]
        File1["Translated PPTX"]
        File2["Comparison PDF"]
        File3["Evaluation Report"]
    end

Prerequisites

  1. Python 3.10+
  2. LibreOffice: Required for converting PPTX to PDF.
    • macOS: brew install --cask libreoffice
    • Windows: Install from official website.
  3. Poppler: Required for the image-based visual comparison.
    • macOS: brew install poppler
    • Windows: Download binary and add to PATH.

Installation

Install via Pip

uv pip install instappt

Development Setup

# Create virtual environment
uv venv

# Activate virtual environment
source .venv/bin/activate

# Install dependencies
uv sync

Usage

CLI Usage (After Installation)

If you installed the package via pip, you can use the instappt command directly:

instappt --input input.pptx --output output_dir --lang English --config model_info.json

Development Usage

If you are running from source:

python main.py --input input.pptx --output output_dir --lang English

Using a Configuration File

Create a model_info.json file to configure your LLM settings:

{
    "translator": {
        "model": "gpt-4o",
        "api_key": "sk-...",
        "base_url": "https://api.openai.com/v1"
    }
}

Run with config:

python main.py --input input.pptx --output output_dir --lang English --config model_info.json

Force Re-translation (Disable Cache)

If you want to ignore the cache and force a fresh translation:

python main.py --input input.pptx --output output_dir --lang English --config model_info.json --no-cache

SDK Usage

You can also use InstaPPT as a Python library in your own projects.

from instappt.core import PPTTranslator
from instappt.models import SDKConfig, ModelConfig

# 1. Configure Models
config = SDKConfig(
    translator_config=ModelConfig(
        model="gpt-4o",
        api_key="sk-...",
        base_url="https://api.openai.com/v1"
    ),
    optimizer_config=ModelConfig(
        model="gpt-4o",
        api_key="sk-...",
        base_url="https://api.openai.com/v1"
    ),
    evaluator_config=ModelConfig(
        model="gpt-4o",
        api_key="sk-...",
        base_url="https://api.openai.com/v1"
    ),
    enable_cache=True # Set to False to disable caching
)

# 2. Initialize Translator
translator = PPTTranslator(config, concurrency=32)

# 3. Process PPTX
input_file = "presentation.pptx"
output_file = "presentation_translated.pptx"
target_language = "English"

translator.process_ppt(input_file, output_file, target_language)

# 4. Generate Reports (Optional)
translator.generate_reports(
    output_dir="output_folder",
    report_prefix="my_report_",
    original_pptx=input_file,
    translated_pptx=output_file
)

Output

The tool generates:

  1. Translated PPTX: [filename]_translated.pptx
  2. Visual Comparison: [filename]_comparison.pdf (Side-by-side images)
  3. Assessment Report: [filename]_assessment_report.pdf (Quality metrics)

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.

All files are saved in the specified output directory.

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

instappt-0.0.2.tar.gz (20.8 MB view details)

Uploaded Source

Built Distribution

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

instappt-0.0.2-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file instappt-0.0.2.tar.gz.

File metadata

  • Download URL: instappt-0.0.2.tar.gz
  • Upload date:
  • Size: 20.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for instappt-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0c7f34df47609347bb36897c97d02cbe99e6d1d77e0e400b878c5468a34e691a
MD5 b3b8274c6cf27b606943bed28c4edb74
BLAKE2b-256 ef06d31b6b556357244f0ed73e3a95c23daf857e407234bdec6708b3a9583f48

See more details on using hashes here.

File details

Details for the file instappt-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: instappt-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for instappt-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 618aa5555ab3ed2412f9b0b4432ed1b4da0f5e87e1a4707196572b967d03ef50
MD5 4500695013564b200af8ac9adf50b4be
BLAKE2b-256 4d907a4403bc13fce47d318f8b1dae09aa2f6efdffac2b6169656ed578902745

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