This is a personal, non-commercial side project I put together to learn — not a product or service.
Post #16 argued that an odd payment only stands out against a normal one. Below is a small prototype that builds that normal from sample data and checks one week against it.
The script doesn't decide whether a payment is fine. It writes down, in one place, what each supplier's own history says is normal, and shows where this week disagrees.
The sample data
Eighteen made-up suppliers, nine weeks of payments, and one week to check. For each supplier the script builds a baseline from the earlier weeks: the usual amount and spread, the usual weekday and the accounts it has used.
| Supplier | Usual amount | Usual day | This week | Result |
|---|---|---|---|---|
| Raw Materials Supplier | ≈ 18,262 | Tue | 3 payments | In band |
| Freight Carrier | ≈ 2,853 | Thu | 4 payments | In band |
| Maintenance Contractor | ≈ 4,214 | Tue | 2 payments | Flagged |
| Software Platform | 2,400 (fixed) | Tue | 1 payment | In band |
| Courier Services | ≈ 415 | Thu | 4 payments | In band |
| Insurance Broker | 5,200 (fixed) | Thu | 1 payment | In band |
How it works
Try it yourself
1 — Clone the repository
2 — Add your own payments (optional)
3 — Run it
4 — Read the output
5 — Change the tolerance
What it's made of
Data source
A plain CSV of payments — no bank connection, no ERP, nothing beyond sample data.
Calculation
Standard Python, no external dependencies — a median, a robust spread and three checks.
Configurable
The tolerance, the repeat window and which signals to use are command-line arguments, not hardcoded.
Read-only by design
The script only reads and reports. It doesn't hold, block or send a single payment, and it is not a substitute for the controls an organisation already has.
What's in the repository
The same personal, non-commercial repository as the earlier demos in this series:
- anomaly_watch_agent.py — the full script used above
- data/payments.csv — the sample data from this walkthrough
- The Collections Priority Agent from Post #12, the Invoice Priority Agent from Post #11, the Idle Cash Agent from Post #10, the FX Monitoring Agent from Post #9 and the Invoice Agent from Post #3
Follow the series
Post #17 looks at a different blind spot: the margin on a single product or customer, and how it can turn negative without anyone seeing it in the monthly average.
Subscribe free