Skip to content

feat(postcodes/SJ): 8 Svalbard + Jan Mayen codes (#1039)#1528

Merged
dr5hn merged 1 commit into
masterfrom
feat/postcodes-svalbard-jan-mayen
May 5, 2026
Merged

feat(postcodes/SJ): 8 Svalbard + Jan Mayen codes (#1039)#1528
dr5hn merged 1 commit into
masterfrom
feat/postcodes-svalbard-jan-mayen

Conversation

@dr5hn
Copy link
Copy Markdown
Owner

@dr5hn dr5hn commented May 5, 2026

Summary

  • Mirrors Svalbard (9170-9178) and Jan Mayen (8099) postcodes from already-shipped NO.json into SJ's own country namespace for Can we add a postcode for this? #1039
  • 8 codes / country-only ship (SJ has no sub-state hierarchy in CSC)

Source

  • Bring (Norway Post) via the Norway importer — already shipped in NO.json under state codes 21 (Svalbard) and 22 (Jan Mayen)
  • This PR derives a companion SJ.json so consumers querying by country_code='SJ' get the data directly

Coverage

code locality
8099 Jan Mayen
9170 Longyearbyen
9171 Longyearbyen
9173 Ny-Ålesund
9174 Hopen
9175 Sveagruva
9176 Bjørnøya
9178 Barentsburg

Test plan

  • python3 -m py_compile bin/scripts/sync/import_svalbard_jan_mayen_postcodes.py
  • All 8 codes match ^\d{4}$
  • No state_id (country-only)
  • No auto-managed fields
  • Idempotent merge

🤖 Generated with Claude Code

Mirrors Svalbard (9170-9178) and Jan Mayen (8099) postcodes from
the already-shipped NO.json into SJ's own country namespace.

Why
---
Svalbard archipelago and Jan Mayen Island are administered by Norway
and use Norwegian post codes already shipped in NO.json under state
codes 21 (Svalbard) and 22 (Jan Mayen). CSC represents Svalbard
and Jan Mayen as their own country (iso2=SJ, country_id=211), so
without a companion SJ.json, postcode lookups for SJ return empty.

Coverage
--------
- 8 codes / country-only ship (SJ has no sub-state hierarchy in CSC)
- Svalbard: 9170, 9171 Longyearbyen; 9173 Ny-Ålesund; 9174 Hopen;
  9175 Sveagruva; 9176 Bjørnøya; 9178 Barentsburg
- Jan Mayen: 8099

Source pipeline
---------------
1. Read NO.json (Bring mirror)
2. Filter to 8 SJ-target codes
3. Re-FK to country_id=211 (SJ)
4. Title-case locality names from the bring-shipped uppercase form

License
-------
Original source: Bring (Norway Post) via Norway importer.
Each row: source: "bring-via-sj-mirror"

Validation
----------
- python3 -m py_compile passes
- 100% regex match (^\d{4}$)
- No state_id (country-only)
- No auto-managed fields (id, created_at, updated_at, flag)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 5, 2026
@dosubot dosubot Bot added the enhancement New feature or request label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

CSC Validation Report

PR Format

  • ✅ Description provided
  • ✅ Data source linked
  • ✅ Issue linked (recommended for data changes)
  • ✅ Justification / context provided

Labels applied: data:postcodes

Schema Validation (8 records)

✅ All records passed validation

Cross-Reference Validation

✅ 8 reference(s) verified

Source URL Verification

✅ 1 source URL(s) accessible


All checks passed | Status: Ready for review

@dr5hn dr5hn merged commit cc95954 into master May 5, 2026
1 check passed
@dr5hn dr5hn deleted the feat/postcodes-svalbard-jan-mayen branch May 5, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:postcodes enhancement New feature or request ready-for-review size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant