Contracted merchant base analysis — utilisation scoring, churn risk flagging, pricing opportunity identification, and renewal forecasting from a single CSV input.
Built to mirror the core workflow of a commercial finance analyst: interrogate the contracted base, surface risks and opportunities, and produce a clean report for stakeholder review.
git clone https://github.com/YOUR_USERNAME/merchant-analytics.git
cd merchant-analytics
python src/analyze.py --input data/samples/merchants.csv --output reports/No dependencies beyond the Python standard library.
merchant-analytics
────────────────────────────────────
Merchants analysed : 15
Total contract value: €1,071,000
Avg utilisation : 67.5%
Unused value : €349,905
High churn risk : 4 merchants
Expiring <90d : 3 merchants
Pricing opps : 4 merchants
- Executive summary — key metrics at a glance
- High churn risk — low-utilisation merchants ranked by exposure
- Pricing opportunities — merchants with discounts that no longer reflect usage
- Contracts expiring within 90 days — renewal pipeline sorted by urgency
- Full merchant base — complete ranked view with trend indicators
Standard CSV with one row per merchant:
merchant_id,name,segment,contract_value_eur,contract_start,contract_end,
avg_monthly_utilisation_pct,last_month_utilisation_pct,payment_volume_eur,
payment_success_rate,renewal_discount_pct,churn_risk
M001,Acme Retail,SMB,24000,2023-01-01,2025-01-01,72,65,1440,97.2,0,low| Signal | Derived metric |
|---|---|
| Avg vs last month utilisation | util_trend: growing / stable / declining |
| Contract value × (1 − utilisation) | unused_value_eur |
| Discount > 0 AND utilisation ≥ 80% | pricing_opportunity |
| Contract end within 90 days | expiring_soon |
merchant-analytics/
├── src/
│ └── analyze.py # Load → enrich → score → report
├── data/samples/
│ └── merchants.csv # Sample merchant base (15 merchants)
├── reports/ # Generated output (gitignored)
└── README.md
| Finance competency | Implementation |
|---|---|
| Contracted base analysis | Utilisation scoring per merchant |
| Risk identification | Churn risk flagging with trend analysis |
| Pricing analysis | Discount vs utilisation mismatch detection |
| Forecasting inputs | Renewal pipeline with days-to-expiry |
| One source of truth | Single CSV in → structured report out |
- Google Sheets integration for live data pull
- Month-over-month utilisation trend charting
- Segment-level P&L roll-up
- Automated email digest for renewals due within 30 days
MIT