This chapter covers the core features and capabilities of Report Generator.
Follow this guide to get Report Generator up and running in your environment.
# 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"Create a JSON config for complex, repeatable reports:
{
"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
}| Flag | Short | Default | Description |
|---|---|---|---|
--source | -s | — | Source data file (CSV, JSON, or SQLite) |
--format | -f | markdown | Output 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 | -o | stdout | Output file path |
--config | -c | — | Report definition file (JSON) |
--title | -t | Report | Report title |
--sort | — | Sort spec: field:order (e.g. revenue_sum:desc) | |
--filter | — | Filter as field:op:value (repeatable) | |
--log-level | INFO | Logging level: DEBUG, INFO, WARNING, ERROR |
| Function | Description |
|---|---|
count | Number of rows in each group |
sum | Sum of values |
avg | Arithmetic mean |
min | Minimum value |
max | Maximum value |
| Operator | Description |
|---|---|
eq | Equal to (default) |
ne | Not equal to |
gt, lt | Greater / less than |
gte, lte | Greater / less than or equal |
contains | Substring match |
regex | Regular expression match |
in | Value in a list (JSON config only) |
not_null | Field is present and non-empty |
is_null | Field is absent or empty |
Get the full Report Generator and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.