Skip to content

feat(postcodes/ZA): bulk-import 5,685 South Africa postcodes via SAPO (#1039)#1449

Merged
dr5hn merged 1 commit into
masterfrom
feat/postcodes-south-africa
Apr 27, 2026
Merged

feat(postcodes/ZA): bulk-import 5,685 South Africa postcodes via SAPO (#1039)#1449
dr5hn merged 1 commit into
masterfrom
feat/postcodes-south-africa

Conversation

@dr5hn
Copy link
Copy Markdown
Owner

@dr5hn dr5hn commented Apr 27, 2026

Summary

Adds 5,685 South Africa postcodes covering 15,373 SA Post Office
reference rows, sourced from the raramuridesign-cc/South-African-Postal-Codes
community mirror.

  • Coverage: country-only by design (no state_id).
  • Multi-row-per-locality: each town has separate PO Box and
    street-delivery codes; emitted as type=po_box / type=street,
    collapsed to type=full when the two codes match.

Why country-only

SA Post Office assigned the 4-digit numeric codes along sorting routes
without aligning to the 9 provinces. There is no canonical
postcode-prefix -> province mapping. Matches the precedent already set
by the Sweden (#1442) and Slovenia (#1445) importers.

Source & licence

Validation

  • python3 -m py_compile clean.
  • 100% of 5,685 codes match country.postal_code_regex (^(\d{4})$).
  • No auto-managed fields (id, created_at, updated_at, flag).
  • country_id consistent with ZA across all rows.

Test plan

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

Refs #1039.

🤖 Generated with Claude Code

…#1039)

Source: SA Post Office reference data redistributed via the
raramuridesign-cc/South-African-Postal-Codes mirror. Each source row
ships separate BoxCode (PO Box) and StrCode (street) deliveries; the
importer emits them as type=po_box / type=street, collapsing to
type=full when the two codes match.

Ships country-only by design: SAPO assigned numeric codes along
sorting routes that do not align with the 9 provinces (matches the
SE/SI precedent in this repo).

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 12:38
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.

Copilot wasn't able to review any files in this pull request.

@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, large-contribution

⚠️ Large Contribution

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

Schema Validation (5685 records)

✅ All records passed validation

Cross-Reference Validation

✅ 5685 reference(s) verified

Source URL Verification

✅ 2 source URL(s) accessible


All checks passed | Status: Ready for review

@dr5hn dr5hn merged commit 35fa5f5 into master Apr 27, 2026
1 check passed
@dr5hn dr5hn deleted the feat/postcodes-south-africa branch April 27, 2026 12:46
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.

2 participants