world-postal-codes / dataset-metadata.json
samyakbayar's picture
Upload world-postal-codes dataset files with full metadata
224d50a verified
Raw History Blame Contribute Delete
13.3 kB
{
"title": "World Postal Code Directory",
"id": "edudev-commons-org/world-postal-codes",
"subtitle": "1,835,923 postal codes in 124 countries with coordinates & hierarchy",
"description": "# World Postal Code Directory\n\n**Subtitle:** 1,835,923 postal codes in 124 countries with coordinates & hierarchy\n\n**Tags:** `tabular`, `geography`, `world`\n\n**Dataset File:** `postal_codes.csv` (1,835,923 rows, 29 columns, 271.3 MB)\n\n**Provenance & Source:** GeoNames Postal Code Database (geonames.org)\n\n**Expected Update Frequency:** `annually`\n\n---\n\n## \ud83d\udcd6 Description\n\n### Postal codes as a geographic index\n\nGeoNames' `allCountries` postal code export is one of the few open, global postal-code lists.\nThis dataset contains **1,835,923 postal-code records in 124 countries**, with **29 parameters**\nper record and duplicates removed on country + code + place + admin1.\n\n- **Address hierarchy** \u2014 country, postal code, place name, admin1/admin2/admin3 names and codes,\n plus an `admin_depth` count.\n- **Geography** \u2014 latitude/longitude, hemisphere, 10-degree latitude band, 15-degree longitude band and\n a 9-character geohash.\n- **Code shape** \u2014 length, numeric flag, two-character prefix, first character.\n- **Quality** \u2014 GeoNames accuracy code and label, plus admin2/admin3 presence flags.\n- **Country context** \u2014 country name, World Bank region and subregion.\n\n**1,128,319 codes are purely numeric**, while the rest use letters or mixed formats. The\nfile supports geocoding, delivery-zone analysis, regional segmentation and postal-format research.\n\n## \ud83e\uddfe Columns (29)\n\n`country_code`, `postal_code`, `place_name`, `admin1_name`, `admin1_code`, `admin2_name`, `admin2_code`, `admin3_name`, `admin3_code`, `latitude`, `longitude`, `accuracy`, `country_name`, `country_region`, `country_subregion`, `postal_length`, `is_numeric_postal`, `postal_prefix`, `postal_first_char`, `hemisphere`, `latitude_band`, `longitude_band`, `accuracy_label`, `has_admin2`, `has_admin3`, `admin_depth`, `place_word_count`, `place_name_length`, `geohash`\n\n## \ud83d\udca1 Ideas for using this data\n\n1. **Postal formats** \u2014 cluster countries by code length and character mix.\n2. **Geocoding** \u2014 join to any address table on country + postal code; measure match rates.\n3. **Population proxies** \u2014 count codes per admin1 area as a proxy for settlement density.\n4. **Spatial clustering** \u2014 geohash prefixes make it easy to bin codes into map tiles.\n5. **Prefix hierarchies** \u2014 check whether the first one or two characters map cleanly to regions.\n6. **Data quality** \u2014 compare GeoNames accuracy classes across countries.\n7. **Missing middle** \u2014 countries with no admin2 data; what does that imply for address matching?\n8. **Place-name NLP** \u2014 tokenise place names to find common suffixes (ville, stad, burg, -pur).\n9. **Map visualisation** \u2014 plot all coordinates coloured by region (use a sample for speed).\n\n## \ud83d\udcc1 Files\n\n| File | What it is |\n|---|---|\n| `postal_codes.csv` | 1,835,923 postal records x 29 parameters. |\n| `data_dictionary.csv` | Column / type / description for every field. |\n| `notebook.ipynb` | Starter notebook that loads the CSV and analyses it. |\n| `dataset-metadata.json` | Kaggle API metadata. |\n| `about.md` | Plain-text About block. |\n\n## \ud83c\udff7\ufe0f Tags\n\n`postal-codes`, `geography`, `geocoding`, `geonames`, `addresses`, `world`, `tabular`\n\n## \ud83d\udd17 Provenance\n\n- **Source:** **GeoNames** postal code export,\n `https://download.geonames.org/export/zip/allCountries.zip` (creative commons attribution).\n- **Format:** tab-separated, 12 fields per line: country code, postal code, place name, admin1\n name/code, admin2 name/code, admin3 name/code, latitude, longitude, accuracy.\n- **Processing:** exact duplicates removed, country names and World Bank regions joined, bands,\n code-shape fields and geohashes derived.\n- **Snapshot date:** 22 November 2026.\n\n## \ud83d\udd04 Update frequency\n\n**Daily upstream; snapshot here.** GeoNames refreshes the postal export regularly.\n\n## \u26a0\ufe0f Caveats\n\n- Postal code systems differ wildly: some countries have none, others map one code to many places.\n- Coordinates are place centroids, not rooftop locations; accuracy varies by country.\n- GeoNames is community-maintained and coverage is uneven outside Europe and North America.\n- Duplicate removal is on country + code + place + admin1, so genuinely repeated codes remain.\n- Codes are formatted as nationally used; no normalisation (spaces, hyphens) is applied.\n- Row order follows the upstream file (country, then code), not any ranking.\n- This file is large; notebook cells should sample or filter before plotting.\n\n## \ud83d\udcdc Licence\n\nGeoNames data is licensed CC BY 4.0 \u2014 attribution to GeoNames is required.\n\n### \ud83d\udccb Column Definitions & File Header\n\n| # | Column Name | Data Type | Description |\n|---|---|---|---|\n| 1 | `country_code` | `string` | ISO 3166-1 alpha-2 country code. |\n| 2 | `postal_code` | `string` | Postal code as used nationally (may contain letters, spaces or hyphens). |\n| 3 | `place_name` | `string` | Primary place name for the code. |\n| 4 | `admin1_name` | `string` | First-level administrative division (state, region, province). |\n| 5 | `admin1_code` | `number` | GeoNames code for the first-level division. |\n| 6 | `admin2_name` | `string` | Second-level division (county, district). |\n| 7 | `admin2_code` | `number` | GeoNames code for the second-level division. |\n| 8 | `admin3_name` | `string` | Third-level division (municipality, commune). |\n| 9 | `admin3_code` | `number` | GeoNames code for the third-level division. |\n| 10 | `latitude` | `number` | Latitude of the place centroid (decimal degrees). |\n| 11 | `longitude` | `number` | Longitude of the place centroid (decimal degrees). |\n| 12 | `accuracy` | `number` | GeoNames accuracy code: 1 estimated, 4 region/state, 6 admin2 centroid. |\n| 13 | `country_name` | `string` | Country common name. |\n| 14 | `country_region` | `number` | World Bank region. |\n| 15 | `country_subregion` | `number` | World Bank subregion. |\n| 16 | `postal_length` | `number` | Number of characters in the postal code. |\n| 17 | `is_numeric_postal` | `boolean` | true when the code contains only digits. |\n| 18 | `postal_prefix` | `string` | First two characters of the postal code (sorting/region prefix). |\n| 19 | `postal_first_char` | `string` | First character of the postal code. |\n| 20 | `hemisphere` | `string` | N/S + E/W hemisphere pair. |\n| 21 | `latitude_band` | `string` | 10-degree latitude band. |\n| 22 | `longitude_band` | `string` | 15-degree longitude band. |\n| 23 | `accuracy_label` | `string` | Human-readable accuracy class. |\n| 24 | `has_admin2` | `boolean` | true when a second-level division is recorded. |\n| 25 | `has_admin3` | `boolean` | true when a third-level division is recorded. |\n| 26 | `admin_depth` | `number` | Number of administrative levels present (1-3 plus country). |\n| 27 | `place_word_count` | `number` | Words in the place name. |\n| 28 | `place_name_length` | `number` | Characters in the place name. |\n| 29 | `geohash` | `string` | 9-character geohash of the coordinates (spatial joins, binning). |\n\n\n\n---\n\n## \ud83c\udf1f Support & Community\nIf you find this dataset valuable for your research, machine learning projects, or data explorations, **please give it an upvote (\ud83d\udc4d) on Kaggle!**\nFeedback, questions, and community notebook submissions are warmly welcomed in the Discussions tab.\n",
"isPrivate": false,
"licenses": [
{
"name": "CC-BY-4.0"
}
],
"keywords": [
"tabular",
"geography",
"world"
],
"resources": [
{
"path": "postal_codes.csv",
"description": "Primary dataset file containing 1,835,923 records across 29 parameters.",
"schema": {
"fields": [
{
"name": "country_code",
"type": "string",
"description": "ISO 3166-1 alpha-2 country code."
},
{
"name": "postal_code",
"type": "string",
"description": "Postal code as used nationally (may contain letters, spaces or hyphens)."
},
{
"name": "place_name",
"type": "string",
"description": "Primary place name for the code."
},
{
"name": "admin1_name",
"type": "string",
"description": "First-level administrative division (state, region, province)."
},
{
"name": "admin1_code",
"type": "number",
"description": "GeoNames code for the first-level division."
},
{
"name": "admin2_name",
"type": "string",
"description": "Second-level division (county, district)."
},
{
"name": "admin2_code",
"type": "number",
"description": "GeoNames code for the second-level division."
},
{
"name": "admin3_name",
"type": "string",
"description": "Third-level division (municipality, commune)."
},
{
"name": "admin3_code",
"type": "number",
"description": "GeoNames code for the third-level division."
},
{
"name": "latitude",
"type": "number",
"description": "Latitude of the place centroid (decimal degrees)."
},
{
"name": "longitude",
"type": "number",
"description": "Longitude of the place centroid (decimal degrees)."
},
{
"name": "accuracy",
"type": "number",
"description": "GeoNames accuracy code: 1 estimated, 4 region/state, 6 admin2 centroid."
},
{
"name": "country_name",
"type": "string",
"description": "Country common name."
},
{
"name": "country_region",
"type": "number",
"description": "World Bank region."
},
{
"name": "country_subregion",
"type": "number",
"description": "World Bank subregion."
},
{
"name": "postal_length",
"type": "number",
"description": "Number of characters in the postal code."
},
{
"name": "is_numeric_postal",
"type": "boolean",
"description": "true when the code contains only digits."
},
{
"name": "postal_prefix",
"type": "string",
"description": "First two characters of the postal code (sorting/region prefix)."
},
{
"name": "postal_first_char",
"type": "string",
"description": "First character of the postal code."
},
{
"name": "hemisphere",
"type": "string",
"description": "N/S + E/W hemisphere pair."
},
{
"name": "latitude_band",
"type": "string",
"description": "10-degree latitude band."
},
{
"name": "longitude_band",
"type": "string",
"description": "15-degree longitude band."
},
{
"name": "accuracy_label",
"type": "string",
"description": "Human-readable accuracy class."
},
{
"name": "has_admin2",
"type": "boolean",
"description": "true when a second-level division is recorded."
},
{
"name": "has_admin3",
"type": "boolean",
"description": "true when a third-level division is recorded."
},
{
"name": "admin_depth",
"type": "number",
"description": "Number of administrative levels present (1-3 plus country)."
},
{
"name": "place_word_count",
"type": "number",
"description": "Words in the place name."
},
{
"name": "place_name_length",
"type": "number",
"description": "Characters in the place name."
},
{
"name": "geohash",
"type": "string",
"description": "9-character geohash of the coordinates (spatial joins, binning)."
}
]
}
},
{
"path": "data_dictionary.csv",
"description": "Field-level data dictionary detailing column names, data types, and semantic definitions."
},
{
"path": "notebook.ipynb",
"description": "Jupyter starter notebook providing exploratory data analysis and baseline visualizations."
}
]
}