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-mt
| Field | Type | Description | Title |
|---|---|---|---|
| country_code | string | ISO 3166-1 alpha-2 code for the country. | Country Code |
| postal_code | string | Postal code for the location. | Postal Code |
| place_name | string | Name of the city, town, or place. | 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 | Latitude coordinate of the place. | Latitude |
| longitude | number | Longitude coordinate of the place. | Longitude |
| accuracy | integer | GeoNames accuracy of latitude/longitude. GeoNames documents 1=estimated, 4=geonameid, 6=centroid of addresses or shape; other values (e.g. 3) occur upstream without documentation. Empty where GeoNames gives none. | 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
- 73
- Format
- CSV
- File size
- 4 kB
About this dataset
Malta (MT): migration notes
Internal record of the P6 migration from the old scripts 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.15
- Commit: see
git log -- datasets/mt(P6 mt commit) - Parity verdict:
format-only(gate: pass, exit 0), against the live public CSV - Producer:
custom, refresh disabled
Sources
| Input | URL | Notes |
|---|---|---|
| GeoNames postal export | https://download.geonames.org/export/zip/MT.zip | Member MT.txt; 3-letter locality prefixes only (GeoNames withholds the 4-digit suffix "for copyright reasons") |
- The file the old
build_postal_codes_product.py(2026-09-15) read from its local snapshotsources/postal_raw/MT.txt. - Stable "latest" URL; nothing versioned to resolve.
mt.inputs.jsonrecords bytes and sha256 per run.
Parity against the live public CSV (2026-10-05)
Rows: 73 live and 73 fresh, none only on one side, 0 changed cells, 0 cell classes, 0 duplicate keys. Same row order. The only difference is line endings: live is CRLF (old builder's csv.DictWriter default), fresh is LF. With \r stripped from live, the files are byte-identical.
No discrepancies to trace.
Decisions
| Decision | By | Basis |
|---|---|---|
| Accept the CRLF→LF difference | Standing rule (format-only parity pre-approved) | 0 changed cells, equal rows |
latitude/longitude → number | Standing rule (real types, as in ad) | All values numeric in the produced CSV |
accuracy → integer, standard GeoNames accuracy description | Standing rule | All values are 4 in the produced CSV |
primaryKey: [postal_code, place_name] | Agent, from the old builder's PK | Unique on the produced CSV; the producer checks it. postal_code alone is also unique today, but the old builder keyed on the pair, so that was kept |
| Old exact-row-count assert dropped | Brief (no row-count asserts) | Structural checks (68 councils, known GeoNames codes, PK unique, MT only, no "nan") kept |
Remove the row/prefix count from the descriptor description | Standing doc rule | Rephrased as "locality prefixes covering all 68 local councils" |
| README.md left unchanged | Agent | It has no counts and no licence_status line, and is neither the "no data yet" stub nor the "sample … contact sales" text; see open questions |
Transforms carried over
From build_postal_codes_product.py (2026-09-15):
- admin_code1: GeoNames numeric admin code ("01".."68") → ISO 3166-2:MT through the old builder's crosswalk (verified by name against Wikipedia's ISO_3166-2:MT, 2026-09-15), including the island swaps (Rabat/Victoria, the two Żebbuġ).
- admin_name1: council name per GeoNames code (GeoNames' own admin_name1 is a Maltese restatement of place_name, e.g. "Il-Birgu").
- postal_code, place_name, coordinates and accuracy as-is; alternative_city_name empty.
- Asserts →
ProducerError: 12 columns, every row MT, known GeoNames codes, no literal "nan", (postal_code, place_name) unique, all 68 councils present. The old "accuracy ends in .0" check is moot (no pandas, values are read as text) and was not ported.
Not ported
- The old builder's generated
datapackage.json/README.md/ATTRIBUTION.txt/zip (build.py and the descriptor own these now), andpublish_r2.py. - The old builder's
postal_codepattern constraint (^[A-Z]{3}$) and its per-field descriptions; the descriptor keeps its existing field descriptions.
Open questions
- pending: README.md is the generic template ("a comprehensive list of postal codes … sourced from official and publicly available records"). For a GeoNames locality-prefix-only dataset this overstates it; the descriptor
descriptionand ATTRIBUTION.txt carry the real caveat. Not one of the brief's stale-README cases, so left as is; the user may want it rewritten from the old builder's README template. .licensing-notes.mdstill quotes dated row counts; left for the pc-hfz sweep.