Contents

Chapter 1

Features

This chapter covers the core features and capabilities of Report Generator.

Features

  • Multi-source input — CSV files, JSON files (flat or nested), SQLite databases
  • Row filtering — Keep rows matching conditions (eq, ne, gt, lt, gte, lte, contains, regex, in, not_null, is_null)
  • Computed columns — Add derived fields via arithmetic expressions or string templates
  • Group-by aggregation — Group by one or more fields with count, sum, avg, min, max
  • Sorting — Sort results by any column, ascending or descending
  • Multiple output formats — Markdown tables, self-contained styled HTML, CSV, JSON
  • Summary statistics — Automatic count, sum, avg, min, max, stdev for every numeric column
  • ASCII bar charts — Inline horizontal bar charts for each aggregate metric
  • JSON report definitions — Declare complete reports in a config file for repeatable generation
  • Automatic type coercion — CSV string values are converted to int/float when possible

Requirements

  • Python 3.10+
  • No external dependencies (stdlib only)
Chapter 2

Quick Start

Follow this guide to get Report Generator up and running in your environment.

Quick Start

bash
# Simple detail report from CSV
python src/report_generator.py --source examples/sample_data.csv --format markdown

# Group by department with aggregated metrics
python src/report_generator.py --source examples/sample_data.csv \
    --group-by department \
    --metrics "revenue:sum,revenue:avg,deals_closed:sum,satisfaction:avg" \
    --sort "revenue_sum:desc" \
    --title "Department Summary"

# Full report from a JSON config file
python src/report_generator.py --config examples/report_generator_config.json

# HTML report written to a file
python src/report_generator.py --source examples/sample_data.csv \
    --group-by department --metrics "revenue:sum" \
    --format html --output department_report.html

# Filter rows before aggregating
python src/report_generator.py --source examples/sample_data.csv \
    --filter "region:eq:North" \
    --group-by department --metrics "revenue:sum"

Configuration Reference

Create a JSON config for complex, repeatable reports:

json
{
    "title": "Q1 Performance Report — AcmeCorp",
    "description": "Quarterly departmental performance summary.",
    "source": {
        "type": "csv",
        "path": "examples/sample_data.csv"
    },
    "filters": [
        {"field": "hours_worked", "op": "gte", "value": 155}
    ],
    "computed_columns": [
        {"name": "revenue_per_hour", "expression": "revenue / hours_worked"}
    ],
    "group_by": ["department"],
    "metrics": [
        {"field": "revenue", "agg": "sum"},
        {"field": "revenue", "agg": "avg"},
        {"field": "deals_closed", "agg": "sum"},
        {"field": "satisfaction", "agg": "avg"}
    ],
    "sort": [{"field": "revenue_sum", "order": "desc"}],
    "output": {"format": "markdown"},
    "charts": true
}

CLI Options

FlagShortDefaultDescription
--source-s—Source data file (CSV, JSON, or SQLite)
--format-fmarkdownOutput format: markdown, md, html, csv, json
--group-by-g—Comma-separated fields to group by
--metrics-m—Metric specs: field:agg (e.g. revenue:sum,hours:avg)
--output-ostdoutOutput file path
--config-c—Report definition file (JSON)
--title-tReportReport title
--sort—Sort spec: field:order (e.g. revenue_sum:desc)
--filter—Filter as field:op:value (repeatable)
--log-levelINFOLogging level: DEBUG, INFO, WARNING, ERROR

Aggregation Functions

FunctionDescription
countNumber of rows in each group
sumSum of values
avgArithmetic mean
minMinimum value
maxMaximum value

Filter Operators

OperatorDescription
eqEqual to (default)
neNot equal to
gt, ltGreater / less than
gte, lteGreater / less than or equal
containsSubstring match
regexRegular expression match
inValue in a list (JSON config only)
not_nullField is present and non-empty
is_nullField is absent or empty
Chapter 3
🔒 Available in full product

Output

Chapter 4
🔒 Available in full product

04_License

You’ve reached the end of the free preview

Get the full Report Generator and unlock everything.

All Chapters

Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.

Full Tool Suite

Access all interactive tools with complete data, all workload profiles, and the full scenario library.

Source Files

Downloadable source code, configuration files, and working examples from every chapter.

Lifetime Updates

Free updates for life. Every new chapter, tool, and improvement included.

Buy Now — $19 →
📦 Free sample included — download another copy for the full product.
Report Generator v1.0.0 — Free Preview