Skip to content

feat(postcodes/SV): bulk-import 262 El Salvador postcodes via Correos de El Salvador (#1039)#1468

Merged
dr5hn merged 1 commit into
masterfrom
feat/postcodes-el-salvador
Apr 27, 2026
Merged

feat(postcodes/SV): bulk-import 262 El Salvador postcodes via Correos de El Salvador (#1039)#1468
dr5hn merged 1 commit into
masterfrom
feat/postcodes-el-salvador

Conversation

@dr5hn
Copy link
Copy Markdown
Owner

@dr5hn dr5hn commented Apr 27, 2026

Summary

Adds 262 El Salvador postcodes spanning all 14 departments, sourced
from the 2025 Correos de El Salvador catalogue redistributed via the
micryptosv/SV-Postales-2025-API CSV.

  • Coverage: 100% department resolution.
  • Granularity: distrito level — one record per
    (4-digit code, distrito + municipio) pair.

How it works

The source ships codes in a 5-digit form (e.g. 02103) where the
always-present leading 0 is a regional grouping prefix. The
importer strips it to obtain the canonical 4-digit form expected by
the country regex ^(?:CP)*(\d{4})$.

Source & licence

Validation

  • python3 -m py_compile clean.
  • 100% of 262 codes match country.postal_code_regex (^(?:CP)*(\d{4})$).
  • 100% of records resolve a valid state_id whose country_id == 66
    and whose iso2 matches state_code.
  • No auto-managed fields (id, created_at, updated_at, flag).

Test plan

  • Importer compiles and runs on a clean checkout.
  • Cross-reference validator passes (regex + FK + state_code agreement).
  • Idempotent merge verified.
  • CI pipeline green.

Refs #1039.

🤖 Generated with Claude Code

… de El Salvador 2025 (#1039)

Source: 2025 Correos de El Salvador catalogue redistributed via the
micryptosv/SV-Postales-2025-API CSV. All 14 departments resolve at
100% via case-insensitive name match. Codes are normalised by
stripping the always-present leading "0" so the canonical 4-digit
form matches the country regex ^(?:CP)*(\\d{4})$.

Refs #1039.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 27, 2026 14:25
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 27, 2026
@dosubot dosubot Bot added the enhancement New feature or request label Apr 27, 2026
@github-actions
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 (262 records)

✅ All records passed validation

Cross-Reference Validation

✅ 524 reference(s) verified

Source URL Verification

✅ 2 source URL(s) accessible


All checks passed | Status: Ready for review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds El Salvador (SV) postcode coverage to the contributions/postcodes/ dataset and introduces a helper importer script to (re)generate/merge the SV postcode file from an upstream CSV source.

Changes:

  • Add contributions/postcodes/SV.json with El Salvador postcodes keyed to SV departments (state_id/state_code).
  • Add bin/scripts/sync/import_el_salvador_postcodes.py to fetch/parse the upstream CSV and write/merge SV postcodes idempotently.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
contributions/postcodes/SV.json New SV postcode contribution dataset (country/state-linked records).
bin/scripts/sync/import_el_salvador_postcodes.py New importer to fetch the upstream CSV, validate/transform codes, resolve state_id, and write/merge SV.json.

@dr5hn dr5hn merged commit f7c6d56 into master Apr 27, 2026
5 checks passed
@dr5hn dr5hn deleted the feat/postcodes-el-salvador branch April 27, 2026 15:07
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.

2 participants