A simple API for generating PowerPoint presentations from JSON schemas.
Claude wrote this. Thanks Claude.
- Create title slides with optional subtitles
- Create bullet point slides with multi-level lists
- Create image slides from URLs with automatic broken image handling
- Create data tables with headers and rows
- Create split layout slides with different content combinations
- Custom filenames for downloaded presentations
- Cloud storage for presentations with public download links
- Presenter notes with detailed error information for troubleshooting
# Install dependencies
poetry install
# Run the server
poetry run python -m app.mainThe API will be available at http://localhost:8080.
# Basic example with V1 features
curl -X POST http://localhost:8080/generate-pptx \
-H "Content-Type: application/json" \
-d @sample.json
# Advanced example with V2 features
curl -X POST http://localhost:8080/generate-pptx \
-H "Content-Type: application/json" \
-d @sample-v2.jsonThe API returns a JSON response with a download URL:
{
"presentation_id": "fb7b0a52-0dbd-4922-b7be-c1a78139466c",
"download_url": "http://localhost:8080/download/fb7b0a52-0dbd-4922-b7be-c1a78139466c",
"filename": "example-presentation.pptx",
"expires_in_hours": 24
}{
"slides": [
{
"type": "title",
"title": "Presentation Title",
"subtitle": "Optional Subtitle"
},
{
"type": "bullet",
"title": "Bullet Points Slide",
"points": [
{
"text": "First level bullet",
"children": [
{
"text": "Second level bullet"
}
]
},
{
"text": "Another first level bullet"
}
]
},
{
"type": "image",
"title": "Image Slide Title",
"url": "https://example.com/image.jpg",
"alt": "Description of the image"
},
{
"type": "table",
"title": "Data Table Title",
"headers": ["Column 1", "Column 2", "Column 3"],
"rows": [
["Row 1, Cell 1", "Row 1, Cell 2", "Row 1, Cell 3"],
["Row 2, Cell 1", "Row 2, Cell 2", "Row 2, Cell 3"]
]
}
],
"filename": "custom-filename.pptx"
}{
"type": "split",
"title": "Split Layout Example",
"layout": "left-right",
"sections": [
{
"type": "bullet",
"points": [
{
"text": "Point on the left side"
}
]
},
{
"type": "image",
"url": "https://example.com/image.jpg",
"alt": "Image on the right side"
}
]
}- Install the Fly CLI:
curl -L https://fly.io/install.sh | sh - Log in to Fly:
fly auth login - Deploy the app:
fly launch
Alternatively, deploy manually:
fly launch --name pptx-api
fly deployThe API supports S3-compatible storage (like Tigris) for storing presentations. Set the following environment variables:
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_ENDPOINT_URL_S3=your_s3_endpoint
AWS_REGION=your_region
BUCKET_NAME=your_bucket_name
If S3 storage is not configured, the API will fall back to local file storage.