Deterministic pipeline to produce unit-level postcode CSV outputs for Jersey, Guernsey, and the Isle of Man, including strict ONSPD-compatible exports.
- Python 3.12+
- Linux/macOS (CI runs on Ubuntu)
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpython -m scripts.cli discover --territory all
python -m scripts.cli harvest --territory all
python -m scripts.cli merge --territory all
python -m scripts.cli map-onspd --territory all
python -m scripts.cli validate --territory all
python -m scripts.cli all --territory all
# live IM sources (ArcGIS + Overpass overlay)
python -m scripts.cli all --territory IM --overlay-config-dir config/live
# live JE/GY sources (ArcGIS + Overpass overlay)
python -m scripts.cli all --territory JE --overlay-config-dir config/live
python -m scripts.cli all --territory GY --overlay-config-dir config/liveEquivalent Make targets:
make discovermake harvestmake mergemake map-onspdmake validatemake allmake test
- Canonical CSVs:
data/out/*.csv - ONSPD CSVs:
data/out/*_onspd.csv - Territory reports:
data/out/reports/*_report.json - Run summary:
data/out/reports/run_summary.json - Temporal state:
data/state/first_last_seen/*.json - Run logs:
data/run_meta/<run_id>.log.jsonl
Given identical config, identical raw inputs, and identical run-date, canonical and ONSPD outputs are byte-stable.
- Source-level failures are tolerated during harvest when other enabled sources succeed.
- If all enabled sources fail for a territory, that territory stage fails.
- ONSPD contract mismatches hard-fail the run with exit code 20.
- Empty canonical output: inspect
data/raw/*anddata/intermediate/*_canonical.json. - ONSPD contract failure: compare
config/onspd_columns.ymlwith output headers. - Missing coordinates: check source WKID values and CRS hints in territory config.
- High invalid counts: inspect
invalid_samplesin intermediate and territory reports.
Stages 1-4 are implemented: scaffold, config loading, source ingestion, deterministic merge/scoring/temporal logic, strict exports, validation reporting, and CI.
config/isle_of_man.ymlkeeps known IM source definitions but defaults all sources to disabled for deterministic local/CI runs.config/live/isle_of_man.ymlenables live IM ArcGIS + Overpass harvesting without changing base config.- IM ArcGIS source list includes
LandRegistryPublicandPPLandRegistryPublicparcel layers (postcode field), plus public address/POI layers and OSM. - JE ArcGIS source list includes
StatesOfJersey/JerseyPlanning(Gazetteer) plusJSearchpostcode centroids. - GY ArcGIS source list includes
CafMapOLaddress points plusCadastreTRPOLparcel postcodes. scripts/harvest/geofabrik_parse.pyaccepts both Overpass-style JSON and standard GeoJSONFeatureCollectionfiles, so fallback extracts can be ingested when provided locally.- Coverage goal bands are reported in territory validation JSON for IM/JE/GY:
- IM target: 46k-47k
- JE target: 15k-16k
- GY target: 12k-13k
- Candidate fallback data sources for local GeoJSON ingestion:
See LICENSE_NOTES.md for source attribution and usage constraints.