Skip to main content

Automated PowerPoint report generation from Excel data via COM

Project description

decx

Automated PowerPoint report generation from Excel data via COM.

decx reads data from Excel workbooks and updates linked OLE objects, tables, delta indicators, color coding, and charts in PowerPoint presentations — all driven from the command line.

Requirements

  • Windows (COM automation requires Windows)
  • Microsoft PowerPoint (installed and licensed)
  • Microsoft Excel (installed and licensed)
  • Python 3.11+

Installation

uv add decx

Or with pip:

pip install decx

Usage

Update presentations

# Single presentation with one Excel file
decx update report.pptx --excel data.xlsx

# Save output to a specific file (instead of modifying in-place)
decx update report.pptx --excel data.xlsx -o updated_report.pptx

# Save output to a directory
decx update report.pptx --excel data.xlsx -o output/

# Batch mode with explicit pptx:xlsx pairs
decx update --pair "us.pptx:us_data.xlsx" --pair "mx.pptx:mx_data.xlsx"

# Batch mode with output directory
decx update --pair "us.pptx:us.xlsx" --pair "mx.pptx:mx.xlsx" -o output/

# Skip specific steps
decx update report.pptx --excel data.xlsx --skip-links --skip-charts

# Use a custom config file
decx update report.pptx --excel data.xlsx --config my_config.yaml

# Verbose output for debugging
decx update report.pptx --excel data.xlsx --verbose

The -o/--output flag controls where results are written:

  • -o result.pptx — write to a specific file (single-file mode only)
  • -o output/ — write to a directory (works with batch mode too)
  • omitted — modify the source file in-place

After processing, decx update prints a summary table per file and a grand total:

report.pptx <- data.xlsx (19.38s)
+--------------+-------+
| Step         | Count |
+--------------+-------+
| Links        |    86 |
| Tables       |    86 |
| Deltas       |     0 |
| Color coding |     0 |
| Charts       |   100 |
+--------------+-------+

All done! 1 file(s) in 19.38s
+--------------+-------+
| Step         | Total |
+--------------+-------+
| Links        |    86 |
| Tables       |    86 |
| Deltas       |     0 |
| Color coding |     0 |
| Charts       |   100 |
+--------------+-------+

Inspect a presentation

decx info report.pptx

Sample output:

Presentation
+----------+----------------------------------------+
| File     | report.pptx                            |
| Slides   | 30                                     |
+----------+----------------------------------------+

OLE Links
+-------------------------------------------+-------+
| Source File                               | Count |
+-------------------------------------------+-------+
| C:\data\tracking_Argentina.xlsx           |    86 |
| Total                                     |    86 |
+-------------------------------------------+-------+

Charts
+-------------------------------------------+-------+
| Type                                      | Count |
+-------------------------------------------+-------+
| Linked                                    |   100 |
| Unlinked                                  |     0 |
+-------------------------------------------+-------+

Special Shapes
+-------------------------------------------+-------+
| Type                                      | Count |
+-------------------------------------------+-------+
| ntbl_ (normal tables)                     |    42 |
| htmp_ (heatmap tables)                    |     3 |
| trns_ (transposed tables)                 |     2 |
| delt_ (delta indicators)                  |     8 |
| _ccst (color-coded)                       |     5 |
+-------------------------------------------+-------+

Delta Templates (Slide 1)
+-------------------------------------------+-------+
| Shape Name                                | Found |
+-------------------------------------------+-------+
| tmpl_delta_pos                            |   v   |
| tmpl_delta_neg                            |   v   |
| tmpl_delta_none                           |   v   |
+-------------------------------------------+-------+

Initialize config

Write the default config.yaml to the current directory:

decx init

Version

decx --version

CLI Reference

decx --version                  Show version and exit
decx --help                     Show help

decx update [FILES] [OPTIONS]   Run the update pipeline
  FILES                         One or more .pptx files (glob patterns OK)
  -e, --excel PATH              Excel data file (or file picker opens)
  -p, --pair PPT:XLSX           Explicit pptx:xlsx pair (repeatable)
  -o, --output PATH             Output file (.pptx) or directory
  -c, --config PATH             Custom config.yaml
  --skip-links                  Skip OLE re-linking
  --skip-deltas                 Skip delta indicator updates
  --skip-coloring               Skip _ccst color coding
  --skip-charts                 Skip chart link updates
  -v, --verbose                 Debug logging

decx info FILE                  Inspect a .pptx file (read-only, no Excel needed)

decx init                       Write default config.yaml to current directory

Configuration

decx ships with sensible defaults. Run decx init to generate a config.yaml you can customize:

heatmap:
  color_minimum: '#F8696B'
  color_midpoint: '#FFEB84'
  color_maximum: '#63BE7B'
  dark_font: '#000000'
  light_font: '#FFFFFF'

ccst:
  positive_color: '#33CC33'
  negative_color: '#ED0590'
  neutral_color: '#595959'
  positive_prefix: '+'
  symbol_removal: '%'

delta:
  template_positive: tmpl_delta_pos
  template_negative: tmpl_delta_neg
  template_none: tmpl_delta_none
  template_slide: 1

links:
  set_manual: true

Pipeline

  1. Re-link OLE objects — point linked Excel objects to a new data file
  2. Populate tables — read Excel ranges and write values into PowerPoint tables
  3. Delta indicators — swap arrow shapes based on positive/negative values
  4. Color coding — apply color rules to _ccst tables
  5. Update charts — refresh linked chart data sources

Benchmark

Reference benchmarks on a 30-slide presentation with 86 OLE objects and 100 charts. Actual speed varies by machine, file size, and disk speed.

Scenario Time
Same Excel file (re-run) ~17s
Different Excel file (same folder) ~36s
Different Excel file (remote/network folder) ~36s

Batch processing 3 country reports: ~60s total.

Note: OLE visual thumbnails are not refreshed during update (they show cached images). This is intentional — refreshing each OLE visual adds ~4s per object for remote files and provides no value since OLE objects are hidden behind native PowerPoint tables. Tables, charts, and delta indicators all receive fresh data directly.

License

MIT

Repository

https://github.com/albertxli/decx

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

decx-0.1.2.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

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

decx-0.1.2-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file decx-0.1.2.tar.gz.

File metadata

  • Download URL: decx-0.1.2.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for decx-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dc99bcac115fc8e9c1c9a1e9b3fd3e288a2ab5ce3ed52cab783ae613ec93e395
MD5 9980c2d77a1977e4c01b9092b80afbc1
BLAKE2b-256 c1973c334e9454a55423133ad7c6d5eb93ec2c48409e2123ba5a339f9b497f53

See more details on using hashes here.

Provenance

The following attestation bundles were made for decx-0.1.2.tar.gz:

Publisher: release.yml on albertxli/decx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decx-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: decx-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for decx-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 059175fff27637f523ea0b632cda6d5f3191b92dd9cf3341faf55c1c9aad1e40
MD5 4d21a70438b669bd515c20be24eb2c64
BLAKE2b-256 1a86498ff77b86c1bfa2925b4c5ceda950c98081bfc1f7131cf9ece72441e160

See more details on using hashes here.

Provenance

The following attestation bundles were made for decx-0.1.2-py3-none-any.whl:

Publisher: release.yml on albertxli/decx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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