Cookbooks¶
1. Basic KPI deck from CSV¶
Use when you need a fast deck with a few headline metrics.
Config pattern¶
provider:
type: "google_slides"
config:
template_id: "<template-id>"
presentation:
name: "Weekly KPI Report"
slides:
- id: "<slide-id-1>"
replacements:
- type: "text"
config:
placeholder: "{{WEEK}}"
replacement: "Week 07"
- type: "text"
config:
placeholder: "{{TOTAL_REVENUE}}"
data_source:
type: "csv"
name: "kpi"
file_path: "./data/kpi.csv"
value_fn: "get_first_value"
value_fn_args:
column: "revenue"
Command¶
slideflow validate config.yml --registry registry.py
slideflow build config.yml --registry registry.py
2. Reusable chart templates with built-ins¶
Use when your team needs consistent visuals across many decks.
Pattern¶
- Define reusable YAML chart templates in
templates/. - Use
type: templatecharts withtemplate_configvalues. - Keep styling in templates, business logic in config/data.
presentation:
name: "Template Driven Deck"
slides:
- id: "<slide-id>"
charts:
- type: "template"
config:
template_name: "bars/bar_basic"
data_source:
type: "csv"
name: "sales"
file_path: "./data/sales.csv"
template_config:
title: "Revenue by Month"
x_column: "month"
y_column: "revenue"
3. Fully custom charts + bulk generation¶
Use when each audience segment needs a tailored deck.
Pattern¶
- Create custom chart and formatter functions in
registry.py - Use batch params CSV for segment variants
- Run with controlled concurrency and rate limit
registry:
- "./registry.py"
presentation:
name: "Q{quarter} {region} Review"
slides:
- id: "<slide-id>"
charts:
- type: "custom"
config:
chart_fn: "build_segment_chart"
data_source:
type: "databricks"
name: "segment_sales"
query: "SELECT * FROM mart.sales WHERE region = '{region}'"
chart_config:
quarter: "{quarter}"
variants.csv:
Command:
Practical tips¶
- Use
--dry-runbefore high-volume runs. - Keep one shared base registry and add team-specific registries as needed.
- Start with CSV-based fixtures for deterministic testing before moving to live connectors.