# Data-to-Report Pipeline

A compact Python pipeline for turning CSV data into a structured Markdown report with summary statistics, simple anomaly detection, and executive notes.

This is a public-safe demonstration project using fictional data. It is designed to show a reproducible data workflow that can be adapted for business intelligence, operations reporting, due diligence, and internal decision support.

## What It Does

- Loads CSV data with the Python standard library
- Detects numeric and categorical columns
- Calculates count, mean, minimum, maximum, and median for numeric fields
- Summarizes categorical distributions
- Flags simple outliers using an interquartile range rule
- Generates a Markdown report from the analysis
- Provides a CLI for repeatable reporting

## Why This Exists

Many operational workflows still move from spreadsheet to manual interpretation to manually written report. This project demonstrates how a lightweight pipeline can turn recurring data into a repeatable reporting process.

The goal is not heavy analytics. The goal is reliable structure: fast first-pass analysis, transparent calculations, and a report format that can be reviewed or extended.

## Quick Start

```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
data-report examples/demo_metrics.csv --output examples/demo_report.md
```

A generated reference report is included at `examples/sample_report.md`.

## Project Structure

```text
src/data_to_report_pipeline/
  __main__.py      CLI entry point
  loader.py        CSV loading and type detection
  analysis.py      Statistics and anomaly detection
  reporting.py     Markdown report generation
examples/
  demo_metrics.csv
  sample_report.md
tests/
  test_analysis.py
```

## Use Cases

- Weekly operational reporting
- Advisory project dashboards
- Market screening summaries
- Due diligence data checks
- CRM or pipeline health reports
- Lightweight KPI monitoring

## Development

```bash
source .venv/bin/activate
python -m pip install -e ".[dev]"
python -m pytest -q
```

## Roadmap

- Excel input
- PDF export
- Chart generation
- Configurable KPI thresholds
- Batch report generation
- Optional dashboard layer

## License

MIT
