Skip to main content

Automated Google Slides presentation builder with charts and data replacements.

Project description

🚀 SlideFlow

License: MIT Python 3.12+ Docs Release CI Code style: black

  ____  _ _     _       __ _                
 / ___|| (_) __| | ___ / _| | _____      __ 
 \___ \| | |/ _` |/ _ \ |_| |/ _ \ \ /\ / / 
  ___) | | | (_| |  __/  _| | (_) \ V  V /  
 |____/|_|_|\__,_|\___|_| |_|\___/ \_/\_/   

         Generate
     Beautiful slides.
       Direct from your data.

SlideFlow is a Python-based tool for generating beautiful, data-driven presentations directly from your data sources.

Key FeaturesHow It WorksInstallationGetting StartedCLI UsageConfigurationCustomizationContributing


✨ Why SlideFlow?

SlideFlow was built to solve a simple problem: automating the tedious process of creating data-heavy presentations. If you find yourself repeatedly copying and pasting charts and metrics into slide decks, SlideFlow is for you.

  • 🎨 Beautiful, Consistent Visuals: Leverage the power of Plotly for stunning, replicable charts. Use YAML templates to create a library of reusable chart designs.
  • 📊 Connect Directly to Your Data: Pull data from CSV files, JSON, Databricks, or even your dbt models. No more manual data exports.
  • Automate Your Reporting: Stop the manual work. Reduce errors and save time. Your presentations are always up-to-date with your latest data.
  • 🚀 Scale Instantly: Need to create a presentation for every customer, region, or product? Generate hundreds of personalized presentations at once from a single template.

🔑 Key Features

  • Declarative YAML Configuration: Define your entire presentation in a simple, human/agent readable YAML file.
  • Multiple Data Source Connectors:
    • csv: For local CSV files.
    • json: For local JSON files.
    • databricks: For running SQL queries directly against Databricks.
    • databricks_dbt: For using your existing dbt models as data sources.
  • Dynamic Content Replacements:
    • Text: Replace simple placeholders like {{TOTAL_REVENUE}} with dynamic values.
    • Tables: Populate entire tables in your slides from a DataFrame.
    • AI-Generated Text: Use OpenAI or Gemini to generate summaries, insights, or any other text, right from your data.
  • Powerful Charting Engine:
    • Plotly Graph Objects: Create any chart you can imagine with the full power of Plotly.
    • YAML Chart Templates: Use packaged built-ins or define reusable local templates.
    • Custom Python Functions: For when you need complete control over your chart generation logic.
  • Extensible and Customizable:
    • Use Function Registries to extend SlideFlow with your own Python functions for data transformations, formatting, and more.
  • Powerful CLI:
    • slideflow build: Generate one or many presentations.
    • slideflow validate: Validate your configuration before you build.
    • slideflow templates: Inspect available template names and parameter contracts.
    • Generate multiple presentations from a single template using a CSV parameter file.

🔧 How It Works

SlideFlow works in three simple steps:

  1. Define: You create a YAML file that defines your presentation. This includes the Google Slides template to use, the data sources to connect to, and the content for each slide (text, charts, etc.).
  2. Connect & Transform: SlideFlow connects to your specified data sources, fetches the data, and applies any transformations you've defined.
  3. Build: SlideFlow creates a new presentation, populates it with your data and charts, and saves it to your Google Drive.

🛠 Installation

pip install slideflow-presentations

🧑‍💻 Getting Started

To create your first presentation, you'll need:

  1. A Google Slides Template: Create a Google Slides presentation with the layout and branding you want. Note the ID of each slide you want to populate.

  2. Your Data: Have your data ready in a CSV file, or have your Databricks credentials configured.

  3. A YAML Configuration File: This is where you'll define your presentation. See the Configuration section for more details.

  4. Google Cloud Credentials: You'll need a Google Cloud service account with access to the Google Slides and Google Drive APIs. Provide your credentials in one of the following ways:

    • Set the credentials field in your config.yml to the path of your JSON credentials file.
    • Set the credentials field in your config.yml to the JSON content of your credentials file as a string.
    • Set the GOOGLE_SLIDEFLOW_CREDENTIALS environment variable to the path of your JSON credentials file or the content of the file itself.

Once you have these, you can run the build command:

slideflow build your_config.yml

⚙️ CLI Usage

SlideFlow comes with a simple CLI.

build

The build command generates your presentation(s).

slideflow build [CONFIG_FILE] [OPTIONS]

Arguments:

  • CONFIG_FILE: Path to your YAML configuration file.

Options:

  • --registry, -r: Path to a Python file containing a function_registry. You can use this option multiple times.
  • --params-path, -f: Path to a CSV file containing parameters for generating multiple presentations.
  • --dry-run: Validate the configuration without building the presentation.

validate

The validate command checks your configuration for errors.

slideflow validate [CONFIG_FILE] [OPTIONS]

Arguments:

  • CONFIG_FILE: Path to your YAML configuration file.

Options:

  • --registry, -r: Path to a Python file containing a function_registry.

📝 Configuration

Your config.yml file is the heart of your SlideFlow project. Here's a high-level overview of its structure:

presentation:
  name: "My Awesome Presentation"
  slides:
    - id: "slide_one_id"
      title: "Title Slide"
      replacements:
        # ... text, table, and AI replacements
      charts:
        # ... chart definitions

provider:
  type: "google_slides"
  config:
    credentials: "/path/to/your/credentials.json"
    template_id: "your_google_slides_template_id"

template_paths:
  - "./templates"

For more detailed information on the configuration options, please see the documentation.


🎨 Customization

SlideFlow is designed to be extensible. You can use your own Python functions for:

  • Data Transformations: Clean, reshape, or aggregate your data before it's used in charts or replacements.
  • Custom Formatting: Format numbers, dates, and other values exactly as you need them.
  • Custom Charts: Create unique chart types that are specific to your needs.

To use your own functions, create a registry.py file with a function_registry dictionary:

# registry.py

def format_as_usd(value):
    return f"${value:,.2f}"

function_registry = {
    "format_as_usd": format_as_usd,
}

You can then reference format_as_usd in your YAML configuration.


📜 License

MIT License © Joe Broadhead

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

slideflow_presentations-0.0.4.tar.gz (233.1 kB view details)

Uploaded Source

Built Distribution

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

slideflow_presentations-0.0.4-py3-none-any.whl (196.0 kB view details)

Uploaded Python 3

File details

Details for the file slideflow_presentations-0.0.4.tar.gz.

File metadata

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

File hashes

Hashes for slideflow_presentations-0.0.4.tar.gz
Algorithm Hash digest
SHA256 5c12501c0e9cec44230f456ceec51a7bdc5b66d7ee4d27129bcaf49846b977fb
MD5 6f6da7f16815ad36136741b6579bdf82
BLAKE2b-256 8d5a3283a81bf3f7f82c33bedfc621cb725752936b23f4b5278462692593823a

See more details on using hashes here.

Provenance

The following attestation bundles were made for slideflow_presentations-0.0.4.tar.gz:

Publisher: release.yml on joe-broadhead/slideflow

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

File details

Details for the file slideflow_presentations-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for slideflow_presentations-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 18fd8e131ee0710e5523d0ab4809da9296a4c71946a6cafb5c2fe7aeb811ff06
MD5 eaa9f50ea647b908f8857306aba26ca8
BLAKE2b-256 5114bb34fb19487506a89f1ee7ba5be935724c8ab0abfb34a9177429399c436c

See more details on using hashes here.

Provenance

The following attestation bundles were made for slideflow_presentations-0.0.4-py3-none-any.whl:

Publisher: release.yml on joe-broadhead/slideflow

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