Part of a Data Solution
- Explore →
Postal Codes Solution
Every worldwide postal-code dataset in one bundle — the ultimate global reference for precise postal codes.
API Access
Access dataset files directly from scripts, code, or AI agents.
Browse dataset files
API Access
Access dataset files directly from scripts, code, or AI agents.
Each file has a stable URL (r-link) that you can use directly in scripts, apps, or AI agents. These URLs are permanent and safe to hardcode.
Start with these files — they give you everything you need to understand and access the dataset.
- 1. Fetch datapackage.yaml to inspect schema and resources
- 2. Download data resources listed in datapackage.yaml
- 3. Read README.md for full context
Data Files
Explore with AIpostal-codes-ai
| Field | Type | Description | Title |
|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 code for the country. | Country Code |
| postal_code | string | Anguilla's single territory-wide postal code (AI-2640), per the Anguilla Postal Service's own address; there is no per-district or per-address code. | Postal Code |
| place_name | string | District, the only administrative tier Anguilla has (ISO 3166-2:AI defines no subdivisions), as named by GeoNames. | Place Name |
| admin_name1 | string | Primary administrative division (e.g., state, region). | Administrative Name 1 |
| admin_code1 | string | Code for the primary administrative division. | Administrative Code 1 |
| admin_name2 | string | Secondary administrative division (e.g., county, district). | Administrative Name 2 |
| admin_code2 | string | Code for the secondary administrative division. | Administrative Code 2 |
| admin_name3 | string | Tertiary administrative division (e.g., municipality, borough). | Administrative Name 3 |
| admin_code3 | string | Code for the tertiary administrative division. | Administrative Code 3 |
| latitude | number | GeoNames district centroid (WGS84). | Latitude |
| longitude | number | GeoNames district centroid (WGS84). | Longitude |
| accuracy | string | Accuracy level of the latitude and longitude coordinates. | Accuracy |
| alternative_city_name | string | Alternative name(s) for the city or place. | Alternative City Name |
Download
Download CSVAbout
- Last updated
- 5 October 2026
- Total rows
- 14
- Format
- CSV
- File size
- 852 B
About this dataset
Anguilla (AI): migration notes
Internal record of the P6 migration from the old script to the producer: the discrepancies found, their causes, and who decided what. This is a dated record, so the numbers are as of the migration and not kept current. It is not shipped.
- Issue: pc-28e.8.1
- Commit: the worktree commit
P6 ai: SST producer; parity format-only (none) (pc-28e.8.1) - Parity verdict:
format-only(gate: pass, exit 0) against the live public CSV - Producer:
custom, refresh disabled
Sources
| Input | URL | Notes |
|---|---|---|
| GeoNames main gazetteer dump | https://download.geonames.org/export/dump/AI.zip | Member AI.txt; the ADM1 entries with country code AI are the districts. Same URL the old builder's docstring and the descriptor sources name (the old builder read a local copy at sources/postal_raw/AI_gazetteer.txt) |
- The URL is stable, not versioned. The fetched size and sha256 are recorded in
data/ai.inputs.json;--no-fetchreuses the cached copy.
Parity against the live public CSV (2026-10-05)
Rows: 14 live and 14 fresh, none only on one side, 0 changed cells, no cell classes. The only difference is line endings: live uses CRLF, the producer writes LF (sha256 differs, content identical). Covered by the standing CRLF→LF sign-off.
No discrepancies to trace.
Decisions
| Decision | By | Basis |
|---|---|---|
| Accept CRLF→LF | Standing rule (user, P5 standing sign-off) | Format only, equal rows, 0 changed cells |
| Hardcode the known district names and fail on an unknown, missing or duplicate district | Agent: port choice | Replaces the old assert len(districts) == 14 with a structural check (every admin unit present, known names) rather than a row-count assert |
Keep postal_code = AI-2640 as a constant | Agent: faithful port | The old builder's THE_ONLY_CODE; Anguilla has one territory-wide code |
Don't fetch GeoNames' postal export (export/zip/AI.zip) | Agent: faithful port | The old builder never read it; the single code is a constant |
latitude/longitude → number; primaryKey: [place_name] | Standing rule (real types, user decision), derived from the produced CSV | place_name is unique; the old builder's own datapackage used the same PK |
accuracy stays string | Agent | The column is always empty (no GeoNames accuracy for dump coordinates); the old builder typed it string. Not the GeoNames postal accuracy field, so the standard accuracy description wasn't applied |
Field descriptions for postal_code, place_name, latitude, longitude taken from the old builder's datapackage (counts removed) | Agent: port choice | The P3 generic descriptions said nothing about the single code or districts |
Coordinates must be finite numbers (else ProducerError) | Agent | New guard against a nan/empty cell reaching a number field |
Transforms carried over
From build_postal_codes_product.py:
- Districts = dump rows with feature code
ADM1and country codeAI;place_nameis the dump'sname,latitude/longitudeits coordinate, copied verbatim. - Rows sorted by
place_name. admin_*,accuracyandalternative_city_nameempty (the old fix for literal "nan" in admin_name1/2/3; the producer uses csv, no pandas).- Old asserts (district count, no "nan", unique place_name) are
ProducerErrors.
Not ported
- The old builder's generated README/ATTRIBUTION/datapackage.json and zip: build.py and the committed descriptor/README own those; free datasets get no zip.
publish_r2.py: removed; publishing is the shared pipeline's job.
Open questions
- None needing the user.
.licensing-notes.mdandATTRIBUTION.txtwere left verbatim (pc-hfz sweep).