Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💷 Paid Late: Which UK Companies Keep Their Suppliers Waiting?

🚧 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:

  1. Who pays late? Which companies and sectors, and is it getting better?
  2. Do they keep their own promises? Standard payment terms compared with how fast they actually pay
  3. Do the numbers add up? Round-number bunching, internally inconsistent reports, and dormant companies filing reports
  4. Does signing the Prompt Payment Code make a difference?
  5. Where are the slow payers headquartered?

Python · SQL (SQLite) · pandas · matplotlib · seaborn · SciPy · GeoPandas · requests (REST API)

Pipeline

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

Notebooks

# 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 🚧

Data sources and licences

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.

Run it yourself

pip install -r requirements.txt
python src/download_data.py && python src/build_database.py && python src/geocode.py
jupyter lab notebooks/

About

Which UK companies keep suppliers waiting? 115K payment-practice reports + Companies House + postcodes.io in SQLite. Python, SQL, pandas. (In progress)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages