Skip to content

feat(postcodes/AX): 37 Åland Islands codes (#1039)#1514

Merged
dr5hn merged 1 commit into
masterfrom
feat/postcodes-aland
May 5, 2026
Merged

feat(postcodes/AX): 37 Åland Islands codes (#1039)#1514
dr5hn merged 1 commit into
masterfrom
feat/postcodes-aland

Conversation

@dr5hn

@dr5hn dr5hn commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

Source

  • Posti.fi PCF — Finland's official daily postal code file (Åland records carry region code FI200 / region name Ahvenanmaa)
  • Same URL pattern as the Finland importer with ~30-day-back HEAD probe to find latest dated file
  • License: Tier 5 (free redistribution permitted with attribution)

State FK strategy

Direct municipality-name match against CSC's 16 AX states (Swedish form). Single alias for Finnish→Swedish drift:

  • 'Maarianhamina' (Finnish) → 'Mariehamn' (Swedish — Åland's only official language is Swedish)

All 16 municipalities covered

Brändö, Eckerö, Finström, Föglö, Geta, Hammarland, Jomala, Kumlinge, Kökar, Lemland, Lumparland, Mariehamn, Saltvik, Sottunga, Sund, Vårdö

Test plan

  • python3 -m py_compile bin/scripts/sync/import_aland_postcodes.py
  • All 37 codes match ^(?:FI)*\d{5}$
  • 100% state_id valid; state.country_id == 2; state_code == state.iso2
  • No auto-managed fields (id, created_at, updated_at, flag)
  • Idempotent merge (re-run produces no diff)

🤖 Generated with Claude Code

Adds Åland Islands' 37 postal codes from Posti.fi's PCF DAT
(Åland-region records, FI200), shipping to AX.json under the
separate CSC country code AX (Åland Islands, country_id=2).

Why
---
Closes the AX gap on issue #1039. Posti's PCF file carries Åland
records under region FI200 / Ahvenanmaa. Companion FI importer
skips these so they ship to AX as a separate country.

Coverage
--------
- 37 codes / 100% state FK
- All 16 Åland municipalities covered

State FK strategy
-----------------
Direct municipality-name match against CSC's 16 AX states (Swedish
form). One alias for Finnish->Swedish drift:
  'Maarianhamina' -> 'Mariehamn' (the canonical Swedish form;
  Åland's only official language is Swedish).

Source pipeline
---------------
Same URL probe as FI importer (PCF_<YYYYMMDD>.dat, ~30-day-back
HEAD probe, ISO-8859-1 fixed-width parse), filtered to FI200
region.

License
-------
Source: Posti.fi PCF (Tier 5 per #1039 license-tier policy).
Each row: source: "posti-fi-pcf"

Validation
----------
- python3 -m py_compile passes
- 100% regex match (^(?:FI)*\d{5}$)
- 100% state_id valid + state.country_id == 2 + state_code agrees
- 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 4, 2026
@dosubot dosubot Bot added the enhancement New feature or request label May 4, 2026
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

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 (37 records)

✅ All records passed validation

Cross-Reference Validation

✅ 74 reference(s) verified

Source URL Verification

✅ 1 source URL(s) accessible


All checks passed | Status: Ready for review

@dr5hn dr5hn merged commit 5f8dd97 into master May 5, 2026
1 check passed
@dr5hn dr5hn deleted the feat/postcodes-aland branch May 5, 2026 11:09
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