feat(postcodes/PM): add Saint Pierre and Miquelon postcode (#1039)#1426
Conversation
Adds the single Saint Pierre and Miquelon postcode 97500. Country-only — the country's regex (^(97500)$) only permits this single code, shared between the two communes (Saint-Pierre and Miquelon-Langlade). Refs: #1039 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CSC Validation ReportPR Format
Labels applied: Schema Validation (1 records)✅ All records passed validation Cross-Reference Validation✅ 1 reference(s) verified ✅ All checks passed | Status: Ready for review |
There was a problem hiding this comment.
Pull request overview
Adds a new postcode contribution file for Saint Pierre and Miquelon (PM) to support the newly introduced postcodes dataset, using the country’s single valid postcode 97500.
Changes:
- Added
contributions/postcodes/PM.jsonwith one country-level postcode record (97500). - Included basic metadata for the postcode record (
country_id,country_code,type,source,locality_name).
| "code": "97500", | ||
| "country_id": 187, | ||
| "country_code": "PM", | ||
| "locality_name": "Saint-Pierre and Miquelon", |
There was a problem hiding this comment.
locality_name uses "Saint-Pierre and Miquelon", which doesn’t match the canonical country name in contributions/countries/countries.json ("Saint Pierre and Miquelon", id 187) and mixes punctuation styles. For a country-only postcode, consider aligning locality_name to the country’s name value (or omit locality_name entirely if you want it to be implicitly country-level).
| "locality_name": "Saint-Pierre and Miquelon", | |
| "locality_name": "Saint Pierre and Miquelon", |
Per Copilot review: country name in countries.json is 'Saint Pierre and Miquelon' (no hyphen), so locality_name should match — was 'Saint-Pierre and Miquelon'.
…#1039) (#1435) Adds the importer + first run for metropolitan France. Uses La Poste's official base-officielle-des-codes-postaux dataset from data.gouv.fr (Licence Ouverte v2.0 / etalab-2.0). 1. bin/scripts/sync/import_laposte_postcodes.py — pipeline reading the ISO-8859-1 / semicolon-delimited CSV. Filters to metropolitan France (skips 971-988 overseas + 980 Monaco). Picks one canonical commune per postcode (first alphabetical). Resolves state via postcode-prefix to département iso2 (75=Paris, 13=Bouches-du-Rhône, etc.) with Corsica's special split (200xx-201xx -> 2A, 202xx+ -> 2B) and a 75 -> 75C override (states.json suffixes Paris's iso2). 2. contributions/postcodes/FR.json — 6,051 codes covering all 96 metropolitan départements + Corsica with 100% state_id resolution. Out of scope (deferred) - Overseas territories (GP/MQ/GF/RE/YT/PM/WF/PF/NC/BL/MF) already have curated postcode files from earlier PRs (#1402, #1417-#1426). La Poste's CSV does include their rows (475 skipped); folding the full La Poste data into those territory files is a follow-up scope decision. - Cedex codes — La Poste publishes a separate "Cedex" file with ~10k business-routing codes that don't correspond to geographic places. Those belong in a separate pipeline if added. Validation (zero errors across 6,051 records) - All codes match countries.postal_code_regex (^(\\d{5})\$) - All FKs resolve, all state_codes agree with state.iso2 - No auto-managed fields present Locality names use Libellé d'acheminement (the form La Poste actually prints on mail) rather than raw INSEE commune names — cleaner casing and accents (e.g. "Sainte-Foy-lès-Lyon" rather than "STE FOY LES LYON"). Note: the source CSV is ALL CAPS for Libellé too; if mixed-case is preferred, a follow-up Title Case pass is straightforward. License & attribution - Source: La Poste / data.gouv.fr (Licence Ouverte v2.0, etalab-2.0) - Each row: source: "laposte" Refs: #1039 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds Saint Pierre and Miquelon's single postcode 97500.
The country's
postal_code_regexis^(97500)$— only one valid code, shared between the two communes (Saint-Pierre and Miquelon-Langlade). Country-only (no state subdivisions in this dataset).Refs: #1039