End-to-End Retail Analytics Pipeline in Python and SQLEnd-to-End Retail Analytics Pipeline in Python and SQL
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
End-to-end retail analytics pipeline that turns raw, messy CSV exports into business decisions, built in Python and SQL and runnable with one command.
What it does:
Cleans and validates 6 relational tables, fixes 585 data-quality issues and logs every action
Loads a SQLite warehouse with keys, constraints and window-function SQL
Customer analytics: RFM segmentation, cohort retention, CAC / LTV by channel, product Pareto, market-basket analysis
Churn prediction model validated on future data (ROC-AUC 0.71, no data leakage)
6-month revenue forecast, best of 3 models by backtest (4.2% MAPE)
Auto-generated Excel report (live formulas, native charts) and an interactive Streamlit dashboard
18 automated tests
Post image
Eros's avatar
Logging every cleaning action is the part I like most: when a number in the report looks strange, you can follow it back to the fix that changed it. With 585 issues, how did you decide which ones the script fixes alone and which ones it only reports?
Mahammadali's avatar
Thanks, that's exactly why I built it that way. Honest answer: in this version there is no "report-only" tier. Every rule applies an action and the log records which one. The logic behind the choices:
Fix automatically when the right answer is unambiguous: country...
Eros's avatar
Thanks for the clear answer, and for looking at my project too! "Never invent a value" is a rule I want to keep in my own pipelines. The quarantine table is a great idea: nothing is lost, and a person can still check those rows later. Good luck with the next version!
Mahammadali's avatar
Thank you. I appreciate the feedback and the great question. Good luck with your project as well!
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started