Python Analytics Playground preview
Situation
In product analytics most tasks start the same way: load an export, clean it, check distributions, chart it — from scratch each time
Task
Turn the routine into shared modules that teammates can extend without fear of breaking existing behavior
Action
load / clean / EDA / viz / pipeline modules mapped to PRD requirements; tests in tests/ check those requirements; uv + ruff tooling
Result
pytest coverage ≥80%; modules stay small and single-purpose, requirements live in the PRD, and the tool extends without breakage
Stack
Pythonpandas / NumPyMatplotlibpytestuv
Source View on GitHub → Updated: Nov 1, 2026
On this page
  1. Situation
  2. Task
  3. Actions
  4. Run
  5. Result
  6. Limitations
  7. Documentation

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 as python -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.

Documentation

Need this reasoning applied to your data?

Tell me the task — I'll come back with a plan: what data it needs, what we test, and how long it takes. I reply within a day.

Discuss a task →