🚧 Work in progress. The data pipeline and audit are done, and the analysis is under way.
Since 2017, large UK companies must publish how quickly they pay their suppliers. This project analyses 115,046 of those reports from 10,253 companies, joined with Companies House data (industry, company type) and postcode geography, to find out:
- Who pays late? Which companies and sectors, and is it getting better?
- Do they keep their own promises? Standard payment terms compared with how fast they actually pay
- Do the numbers add up? Round-number bunching, internally inconsistent reports, and dormant companies filing reports
- Does signing the Prompt Payment Code make a difference?
- Where are the slow payers headquartered?
Python · SQL (SQLite) · pandas · matplotlib · seaborn · SciPy · GeoPandas · requests (REST API)
Payment practices CSV ──┐
├─► src/build_database.py ─► payments.db (SQLite) ─► notebooks 01–07
Companies House (5.7M) ─┘ ▲
postcodes.io API ─► src/geocode.py ──┘
| Step | What it does |
|---|---|
src/download_data.py |
Streams the two source files to data/raw/ and records provenance (URL, time, size, SHA-256) |
src/build_database.py |
Loads the raw data into SQLite. It reads the 2.8 GB Companies House file in chunks and keeps only the ~10k reporting companies. |
src/geocode.py |
Bulk-geocodes postcodes via the postcodes.io API, 100 per request, with caching |
| # | Notebook | Status |
|---|---|---|
| 01 | Data audit: 8 data-quality issues found and sized before any cleaning | ✅ |
| 02 | Cleaning: one documented rule per issue | 🚧 |
| 03 | SQL analysis: joins, HAVING, CASE, window functions |
🚧 |
| 04 | Trends and sectors | 🚧 |
| 05 | Forensics: do the numbers add up? | 🚧 |
| 06 | Statistics: does the Prompt Payment Code work? | 🚧 |
| 07 | Map | 🚧 |
All sources are open data. Full details, retrieval times and checksums are in DATA_SOURCES.md.
- Payment practices reports: Department for Business and Trade, Open Government Licence v3.0
- Company data: Companies House, Open Government Licence v3.0
- Postcode geography: postcodes.io. Contains OS data © Crown copyright and database right; contains ONS data.
pip install -r requirements.txt
python src/download_data.py && python src/build_database.py && python src/geocode.py
jupyter lab notebooks/