Skip to content

uioreanu/analytics-decision-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analytics Decision Kit

Small open-source analytics starter kit for customer KPIs, revenue concentration, segmentation and short executive summaries.

The repo is built notebook-first.

What is in here

  • synthetic ecommerce order data
  • customer level KPI calculation
  • customer revenue deciles
  • pareto / top customer concentration
  • simple customer segmentation
  • short executive summary text
  • tests, becuase code without tests is basically hope in a hoodie

Quick start

git clone https://github.com/uioreanu/analytics-decision-kit.git
cd analytics-decision-kit

python -m venv .venv
.venv\Scripts\activate  # Windows
pip install -e ".[dev]"

python examples/01_customer_concentration.py
pytest

Python example

from analytics_decision_kit.sample_data import create_demo_orders
from analytics_decision_kit.customer_analysis import run_customer_analysis

orders = create_demo_orders(n_customers=5000, n_orders=18000, seed=42)
results = run_customer_analysis(orders)

print(results["summary_text"])
print(results["decile_summary"])

Optional public GitHub dataset

from analytics_decision_kit.data_loader import (
    DEFAULT_SUPERSTORE_GITHUB_URL,
    get_transactional_data,
)

# No URL -> synthetic data
synthetic_orders = get_transactional_data()

# GitHub/raw CSV URL -> public dataset normalized to the same schema
public_orders = get_transactional_data(DEFAULT_SUPERSTORE_GITHUB_URL)

The output schema is the same in both cases:

order_id, customer_id, order_date, revenue, category, manufacturer

Data needed

The input dataframe should have:

column meaning
customer_id customer id
order_id order id
order_date date of the order
revenue revenue amount
category optional
manufacturer optional

Public / safe by design

Use synthetic or public data only. Alternatively using a public available dataset like "Sample Superstore CSV"

Initial scope

The first version is deliberately small:

  1. create demo data
  2. calculate customer metrics
  3. split customers into revenue deciles
  4. calculate top customer revenue concentration
  5. assign basic segments
  6. write a short summary

About

Python toolkit for customer analytics, KPI logic, revenue concentration, segmentation and executive summaries.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors