DEV Community

Tom
Tom

Posted on Originally published at slideforge.dev

Automate PowerPoint Reports from Excel with Python

You can automate your weekly PowerPoint reports from Excel data with 10 lines of Python — no manual formatting, no copy-pasting charts, no last-minute slide tweaks. This guide shows two approaches: python-pptx for full control, and SlideForge's API for consulting-quality output in seconds.

The problem: manual report decks

Every Monday morning, someone opens an Excel file, copies numbers into a PowerPoint template, screenshots a chart, pastes it, adjusts the alignment. For a 15-slide weekly report, this takes 1-2 hours. Every week.

Approach 1: python-pptx (free, full control)

import pandas as pd
from pptx import Presentation
from pptx.util import Inches, Pt

df = pd.read_excel("weekly_metrics.xlsx", sheet_name="Summary")
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6])
txBox = slide.shapes.add_textbox(Inches(1), Inches(2), Inches(10), Inches(2))
txBox.text_frame.text = "Weekly Report"
txBox.text_frame.paragraphs[0].font.size = Pt(36)
# ... 500+ lines for a full 15-slide deck
prs.save("weekly_report.pptx")
Enter fullscreen mode Exit fullscreen mode

This works, but maintaining 500+ lines of layout code is a burden.

Approach 2: SlideForge API (10 lines)

import requests

resp = requests.post(
    "https://api.slideforge.dev/v1/render",
    headers={"Authorization": "Bearer sf_live_YOUR_KEY"},
    json={
        "template": "kpi_dashboard",
        "params": {
            "title": "Week 14 Performance",
            "metrics": [
                {"value": "$12.4M", "label": "Revenue", "trend": "+18%", "trend_dir": "up"},
                {"value": "847", "label": "Clients", "trend": "+23%", "trend_dir": "up"},
            ],
        },
        "theme_id": "consulting_blue",
    },
)
print(resp.json()["pptx_url"])  # ready in <1s
Enter fullscreen mode Exit fullscreen mode

$0.03 per slide. For a full deck, use the deck endpoint (~3s for 5 slides in parallel).

Scheduling

Cron: 0 7 * * 1 python3 weekly_report.py

GitHub Actions:

on:
  schedule:
    - cron: '0 7 * * 1'
Enter fullscreen mode Exit fullscreen mode

Also works with Airflow, n8n, and Zapier.

Cost comparison

  • python-pptx: Free, 500+ lines, 2-4 hours to build
  • SlideForge: $0.03-$0.05/slide = $23-39/year for a 15-slide weekly report
  • Manual: 1-2 hours/week = $2,500-5,000/year

Sign up for $3 free credit.


Originally published at slideforge.dev

Top comments (0)