Home
cd ../playbooks
Data & ReportingIntermediate

Automated Report Generator

Generate professional data reports with charts, tables, and visualizations

10 minutes
By communitySource
#report#generator#data#visualization

Your stakeholders need a polished report by tomorrow and you're still wrestling with chart formatting in Excel. Every month it's the same cycle: pull data, build tables, create visualizations, write commentary, and format everything to look professional. Automated report generation turns raw data into presentation-ready reports.

Who it's for: data analysts producing recurring reports for business stakeholders, operations managers generating weekly or monthly performance reports, finance teams creating formatted financial report packages, marketing analysts building campaign performance reports, business intelligence teams automating executive dashboards

Example

"Generate a monthly performance report from this data" → Professional report: formatted data tables with conditional highlighting, charts and visualizations for key metrics, trend commentary, executive summary section, and export-ready formatting for PDF or presentation

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Report Generator

## Overview

This workflow enables automatic generation of professional data reports. Create dashboards, KPI summaries, and analytical reports with charts, tables, and insights from your data.

## How to Use

1. Provide data (CSV, Excel, JSON, or describe it)
2. Specify the type of report needed
3. I'll generate a formatted report with visualizations

**Example prompts:**
- "Generate a sales report from this data"
- "Create a monthly KPI dashboard"
- "Build an executive summary with charts"
- "Produce a data analysis report"

## Domain Knowledge

### Report Components

```python
# Report structure
report = {
    'title': 'Monthly Sales Report',
    'period': 'January 2024',
    'sections': [
        'executive_summary',
        'kpi_dashboard',
        'detailed_analysis',
        'charts',
        'recommendations'
    ]
}
```

### Using Python for Reports

```python
import pandas as pd
import matplotlib.pyplot as plt
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

def generate_report(data, output_path):
    # Load data
    df = pd.read_csv(data)
    
    # Calculate KPIs
    total_revenue = df['revenue'].sum()
    avg_order = df['revenue'].mean()
    growth = df['revenue'].pct_change().mean()
    
    # Create charts
    fig, axes = plt.subplots(2, 2, figsize=(12, 10))
    df.plot(kind='bar', ax=axes[0,0], title='Revenue by Month')
    df.plot(kind='line', ax=axes[0,1], title='Trend')
    plt.savefig('charts.png')
    
    # Generate PDF
    # ... PDF generation code
    
    return output_path
```

### HTML Report Template

```python
def generate_html_report(data, title):
    html = f'''
    <!DOCTYPE html>
    <html>
    <head>
        <title>{title}</title>
        <style>
            body {{ font-family: Arial; margin: 40px; }}
            .kpi {{ display: flex; gap: 20px; }}
            .kpi-card {{ background: #f5f5f5; padding: 20px; border-radius: 8px; }}
            .metric {{ font-size: 2em; font-weight: bold; color: #2563eb; }}
            table {{ border-collapse: collapse; width: 100%; }}
            th, td {{ border: 1px solid #ddd; padding: 12px; text-align: left; }}
        </style>
    </head>
    <body>
        <h1>{title}</h1>
        <div class="kpi">
            <div class="kpi-card">
                <div class="metric">${data['revenue']:,.0f}</div>
                <div>Total Revenue</div>
            </div>
            <div class="kpi-card">
                <div class="metric">{data['growth']:.1%}</div>
                <div>Growth Rate</div>
            </div>
        </div>
        <!-- More content -->
    </body>
    </html>
    '''
    return html
```

## Example: Sales Report

```python
import pandas as pd
import matplotlib.pyplot as plt

def create_sales_report(csv_path, output_path):
    # Read data
    df = pd.read_csv(csv_path)
    
    # Calculate metrics
    metrics = {
        'total_revenue': df['amount'].sum(),
        'total_orders': len(df),
        'avg_order': df['amount'].mean(),
        'top_product': df.groupby('product')['amount'].sum().idxmax()
    }
    
    # Create visualizations
    fig, axes = plt.subplots(2, 2, figsize=(14, 10))
    
    # Revenue by product
    df.groupby('product')['amount'].sum().plot(
        kind='bar', ax=axes[0,0], title='Revenue by Product'
    )
    
    # Monthly trend
    df.groupby('month')['amount'].sum().plot(
        kind='line', ax=axes[0,1], title='Monthly Revenue'
    )
    
    plt.tight_layout()
    plt.savefig(output_path.replace('.html', '_charts.png'))
    
    # Generate HTML report
    html = generate_html_report(metrics, 'Sales Report')
    
    with open(output_path, 'w') as f:
        f.write(html)
    
    return output_path

create_sales_report('sales_data.csv', 'sales_report.html')
```

## Resources

- [Matplotlib](https://matplotlib.org/)
- [Plotly](https://plotly.com/)
- [ReportLab](https://www.reportlab.com/)

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

This workflow enables automatic generation of professional data reports. Create dashboards, KPI summaries, and analytical reports with charts, tables, and insights from your data.


Quick Start

Step 1: Create a Project Folder

mkdir -p ~/Documents/ReportGenerator

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ~/Documents/ReportGenerator/

Step 3: Start Working

cd ~/Documents/ReportGenerator
claude

How to Use

  1. Provide data (CSV, Excel, JSON, or describe it)
  2. Specify the type of report needed
  3. I'll generate a formatted report with visualizations

Example prompts:

  • "Generate a sales report from this data"
  • "Create a monthly KPI dashboard"
  • "Build an executive summary with charts"
  • "Produce a data analysis report"

$Related Playbooks

Data & Reporting

SaaS Metrics Dashboard

SaaS business metrics analysis - MRR, ARR, Churn, LTV, CAC, cohort analysis, and investor reporting

10 minutes
Advanced
Data & Reporting

Scientific Exploratory Data Analysis

Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats. This skill should be used when analyzing any scientific data file to understand its structure, content, quality, and characteristics. Automatically ...

10 minutes
Intermediate
Data & Reporting

Scientific Geomaster

Comprehensive geospatial science skill covering remote sensing, GIS, spatial analysis, machine learning for earth observation, and 30+ scientific domains. Supports satellite imagery processing (Sentinel, Landsat, MODIS, SAR, hyperspectral), vector...

5 minutes
Beginner
Data & Reporting

Scientific Geopandas

Python library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial analysis, geometric operations, coordinate transformations, spatial joins, overlay operat...

10 minutes
Intermediate
Data & Reporting

Scientific Hypogenic

Automated LLM-driven hypothesis generation and testing on tabular datasets. Use when you want to systematically explore hypotheses about patterns in empirical data (e.g., deception detection, content analysis). Combines literature insights with da...

15 minutes
Advanced
Data & Reporting

Scientific Infographics

'Create professional infographics using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro for quality review. Integrates research-lookup and web search for accurate data. Supports 10 infographic types, 8 industry styles, and co...

10 minutes
Intermediate
Data & Reporting

Scientific Matplotlib

Low-level plotting library for full customization. Use when you need fine-grained control over every plot element, creating novel plot types, or integrating with specific scientific workflows. Export to PNG/PDF/SVG for publication. For quick stati...

5 minutes
Beginner
Data & Reporting

Scientific Networkx

Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centra...

10 minutes
Intermediate
Data & Reporting

Scientific Plotly

Interactive visualization library. Use when you need hover info, zoom, pan, or web-embeddable charts. Best for dashboards, exploratory analysis, and presentations. For static publication figures use matplotlib or scientific-visualization.

5 minutes
Beginner
Data & Reporting

Scientific Polars

Fast in-memory DataFrame library for datasets that fit in RAM. Use when pandas is too slow but data still fits in memory. Lazy evaluation, parallel execution, Apache Arrow backend. Best for 1-100GB datasets, ETL pipelines, faster pandas replacemen...

10 minutes
Intermediate
Data & Reporting

Scientific Dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For...

10 minutes
Intermediate
Data & Reporting

Scientific Datacommons Client

Work with Data Commons, a platform providing programmatic access to public statistical data from global sources. Use this skill when working with demographic data, economic indicators, health statistics, environmental data, or any public datasets ...

10 minutes
Intermediate

Browse all Data & Reporting playbooks →