Skip to content

About

Terminal-native e-commerce sales intelligence CLI — RFM segmentation, cohort retention, CLV, and more in your shell

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

esales — E-commerce Sales Intelligence CLI

A terminal-native analytics tool that turns a orders CSV into actionable sales intelligence — no browser, no dashboards, just your shell.

Built with Typer, Rich, Plotext, and pandas.

Commands

Command What it does
esales summary Revenue KPIs + monthly trend + category breakdown
esales rfm RFM segmentation — Champions, Loyal, At Risk, Lost…
esales cohorts Monthly customer retention cohort table
esales top-products Best and worst SKUs by revenue & volume
esales clv Customer lifetime value distribution + top spenders

Every command accepts --file / -f to point at your own CSV (defaults to the included sample).

Quick Start

git clone https://github.com/datawithdon/ecommerce-sales-cli.git
cd ecommerce-sales-cli
pip install -r requirements.txt
pip install -e .

# Run with sample data (included)
esales summary
esales rfm
esales cohorts
esales top-products
esales clv

# Use your own data
esales summary --file path/to/orders.csv
esales rfm --file path/to/orders.csv --segment "At Risk"
esales top-products --file path/to/orders.csv --top 15

Alternatively without installing:

python -m esales summary

CSV Format

Column Type Description
order_id string Unique order ID
customer_id string Customer identifier
product string Product name
category string Product category
order_date date Order date (YYYY-MM-DD)
quantity int Units ordered
unit_price float Price per unit
discount_pct float Discount as decimal (0.10 = 10%)
revenue float Actual revenue collected
status string completed or refunded

Regenerate Sample Data

python generate_sample_data.py
# → data/sample_sales.csv  (2,000+ orders, 320 customers, 25 products, 2 years)

RFM Segments

Segment Description
Champions High recency, frequency, and monetary value
Loyal Regular buyers with strong spend
Potential Loyalists Recent shoppers, not yet frequent
New Customers Very recent, first-time buyers
At Risk Used to buy often — going quiet
Hibernating Low across all three dimensions
Lost Haven't bought in a long time

Tech Stack

  • Typer — CLI framework
  • Rich — terminal formatting, tables, panels
  • Plotext — ASCII charts in the terminal
  • pandas — data wrangling

License

MIT

About

Terminal-native e-commerce sales intelligence CLI — RFM segmentation, cohort retention, CLV, and more in your shell

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages