Skip to content

feat(postcodes/UY): 1,964 Correo Uruguayo codes (#1039)#1532

Merged
dr5hn merged 1 commit into
masterfrom
feat/postcodes-uruguay
May 6, 2026
Merged

feat(postcodes/UY): 1,964 Correo Uruguayo codes (#1039)#1532
dr5hn merged 1 commit into
masterfrom
feat/postcodes-uruguay

Conversation

@dr5hn
Copy link
Copy Markdown
Owner

@dr5hn dr5hn commented May 5, 2026

Summary

Source

  • ale-uy/CPuy — Apache-2.0
  • File: db (SQLite, 151 KB)
  • Upstream: Correo Uruguayo public lookup

State FK strategy

ASCII-fold + name match against CSC UY states. All 19 source departments match CSC names verbatim under NFKD fold (handles PAYSANDU → Paysandú, RIO NEGRO → Río Negro, etc.).

Pipeline

  1. Fetch SQLite db via urllib (151 KB)
  2. Parse with stdlib sqlite3 (no extra deps)
  3. Title-case uppercase locality names for display

Distribution (top 5)

iso2 department rows
CA Canelones 291
CO Colonia 147
TA Tacuarembó 126
CL Cerro Largo 125
SJ San José 113

All 19 departments covered.

Test plan

  • python3 -m py_compile bin/scripts/sync/import_uruguay_postcodes.py
  • All 1,964 codes match ^\d{5}$
  • 100% state_id valid; state.country_id == 235; state_code == state.iso2
  • No auto-managed fields
  • Idempotent merge

🤖 Generated with Claude Code

Adds Uruguay's 5-digit postal codes from the ale-uy/CPuy
Apache-2.0 SQLite mirror.

Why
---
Closes the UY gap on issue #1039. Source is a comprehensive SQLite
db with departamento + localidad + código_postal joined.

Coverage
--------
- 1,964 codes / 100% state FK
- All 19 CSC UY departments covered

State FK strategy
-----------------
ASCII-fold + name match against CSC UY states. All 19 source
departments match CSC names verbatim under NFKD fold (handles
PAYSANDU -> Paysandú, RIO NEGRO -> Río Negro, etc.).

Source pipeline
---------------
1. Fetch SQLite db via urllib (151 KB)
2. Parse with stdlib sqlite3 (no extra deps)
3. Title-case uppercase locality names for display

License
-------
ale-uy/CPuy: Apache-2.0.
Upstream: Correo Uruguayo public lookup.
Each row: source: "correo-uruguayo-via-ale-uy"

Validation
----------
- python3 -m py_compile passes
- 100% regex match (^\d{5}$)
- 100% state_id valid + state.country_id == 235 + 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 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, large-contribution

⚠️ Large Contribution

This PR contains 1964 records. Large contributions require manual review.

Schema Validation (1964 records)

✅ All records passed validation

Cross-Reference Validation

✅ 3928 reference(s) verified

Source URL Verification

✅ 2 source URL(s) accessible


All checks passed | Status: Ready for review

@dr5hn dr5hn merged commit e9b6f69 into master May 6, 2026
1 check passed
@dr5hn dr5hn deleted the feat/postcodes-uruguay branch May 6, 2026 13:00
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 large-contribution 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