Python Analytics Playground
▶ Data-flow diagram — self-contained HTML, opens in a browser — no install, no build
Situation
In product analytics, most tasks start the same way: load an export, clean it, look at distributions and correlations, show charts. This project turns that routine into reusable modules — so every new analysis starts not from scratch, but from a tested foundation you can hand to teammates and extend without fear of breaking it.
Task
I needed routine analysis to stop starting from scratch, so I owned the shared module set covering loading, cleaning, distribution checks, and charts as a tested foundation others can extend.
Actions
Package layout (src/python_analytics/):
load.py(REQ-002) — CSV loading into a DataFrame with basic checks.clean.py(REQ-003) — missing values, duplicates, type coercion.eda.py(REQ-004) — descriptive stats, missingness, correlations.viz.py(REQ-005) — histograms, correlation heatmaps.pipeline.py(REQ-006) — end-to-end pipeline runnable aspython -m python_analytics.segment.py— value segments, age cohorts and Pareto instead of RFM: the data is cross-sectional, with no transaction history.report.py— assembles a markdown report from the EDA and viz results.
Each module covers a single requirement from the PRD (docs/prd.md), and the 34 tests in tests/ check exactly those requirements — coverage ≥80%.
Run
uv sync --all-groups
uv run pytest # tests + coverage (≥80%)
uv run python -m python_analytics # end-to-end pipeline
Result
The key difference from one-off analysis scripts is structure and testability: modules are small and single-purpose, requirements are documented in a PRD, and tests keep coverage ≥80%. You can extend the tool and not fear breaking existing behavior.
Limitations
The pipeline targets tabular CSVs and a basic EDA set — it is not a framework for arbitrary pipelines. The ≥80% coverage applies to the package modules, not to user analyses built on top of them.