Premium
You're viewing a free sample
Get the complete dataset — all rows and files — delivered instantly after checkout.
- Secure checkout via Stripe
- Instant download after payment
- 7-day re-download link
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.yml to inspect schema and resources
- 2. Download data resources listed in datapackage.yml
- 3. Read README.md for full context
Data Files
Explore with AIPostal Codes Data Resource for Canada, CA
| Field | Description | Title |
|---|---|---|
| country_code | ISO 3166-1 alpha-2 code for the country. | Country Code |
| postal_code | Postal code for the location. | Postal Code |
| place_name | Name of the city, town, or place. | Place Name |
| admin_name1 | Primary administrative division (e.g., state, region). | Administrative Name 1 |
| admin_code1 | Code for the primary administrative division. | Administrative Code 1 |
| admin_name2 | Secondary administrative division (e.g., county, district). | Administrative Name 2 |
| admin_code2 | Code for the secondary administrative division. | Administrative Code 2 |
| admin_name3 | Tertiary administrative division (e.g., municipality, borough). | Administrative Name 3 |
| admin_code3 | Code for the tertiary administrative division. | Administrative Code 3 |
| latitude | Latitude coordinate of the place. | Latitude |
| longitude | Longitude coordinate of the place. | Longitude |
| accuracy | Accuracy level of the latitude and longitude coordinates. | Accuracy |
| alternative_city_name | Alternative name(s) for the city or place. | Alternative City Name |
Download
Download CSVAbout
- Last updated
- 7 November 2024
- Total rows
- ...
- Format
- CSV
- File size
- 6.81 kB
- Source
- Multiple sources
Postal Codes Data Resource for Canada, CA
| Field | Description | Title |
|---|---|---|
| country_code | ISO 3166-1 alpha-2 code for the country. | Country Code |
| postal_code | Postal code for the location. | Postal Code |
| place_name | Name of the city, town, or place. | Place Name |
| admin_name1 | Primary administrative division (e.g., state, region). | Administrative Name 1 |
| admin_code1 | Code for the primary administrative division. | Administrative Code 1 |
| admin_name2 | Secondary administrative division (e.g., county, district). | Administrative Name 2 |
| admin_code2 | Code for the secondary administrative division. | Administrative Code 2 |
| admin_name3 | Tertiary administrative division (e.g., municipality, borough). | Administrative Name 3 |
| admin_code3 | Code for the tertiary administrative division. | Administrative Code 3 |
| latitude | Latitude coordinate of the place. | Latitude |
| longitude | Longitude coordinate of the place. | Longitude |
| accuracy | Accuracy level of the latitude and longitude coordinates. | Accuracy |
| alternative_city_name | Alternative name(s) for the city or place. | Alternative City Name |
Download
Download CSVAbout
- Last updated
- 7 November 2024
- Total rows
- ...
- Format
- CSV
- File size
- 5.96 kB
- Source
- Multiple sources
About this dataset
Canada Postal Codes — Data Source & Enrichment Plan
Status: Proposed Date: 2026-07-15 Owner: Data pipeline team
1. Problem
The current Canada (ca) product is generated by scripts/custom_parsing_scripts/canada_parse.py,
which parses the StatCan Open Database of Addresses (ODA). Analysis shows this source is
materially incomplete for a postal-code product:
- ~5% national coverage — 45,169 unique postal codes vs Canada's ~900k.
- 5 of 13 provinces/territories only — Ontario, Nova Scotia, British Columbia, Quebec,
New Brunswick. Alberta, Manitoba, Saskatchewan, PEI, Newfoundland & Labrador and the three
territories carry no postal codes in ODA (the
postal_codefield is left blank by those data providers). - Frozen source — ODA is pinned to the
2021001vintage. Last year's output file is byte-for-byte identical (MD58a656cc4e1f62a7060227c24e58ed9ac) to a fresh regeneration. Re-running the job produces the same result; there is no fuller historical edition to recover. - 92% duplicate postal codes — ODA is an address database (many civic addresses per code).
The live published data (/ca/geonames/latest) matches neither the current StatCan output nor a
clean Geonames dump — it contains malformed zero-padded codes (e.g. 0000T0A) from an older,
broken parse.
2. Source comparison
| Source | Rows | Unique PCs | Granularity | Provinces/terr. | National coverage |
|---|---|---|---|---|---|
Geonames CA_full.csv.zip | 900,676 | 899,779 | Full 6-char | 13 | ~100% |
Geonames CA.zip (small) | 1,657 | 1,653 | FSA (3-char) | 13 | FSA map only |
StatCan ODA (canada_parse.py) | 580,497 | 45,169 | Full 6-char | 5 | ~5% |
Geonames CA_full is the only complete, all-province, full-postal-code source. It becomes
the source of record. Its single gap is an empty second-level administrative division
(admin_name2/admin_code2 — county/municipality).
3. Goal
Produce a ca dataset that:
- Uses Geonames
CA_fullas the base (900k codes, all 13 provinces/territories). - Enriches the empty
admin_name2/admin_code2(municipality/census-subdivision) where a trustworthy source exists. - Retires the StatCan-only pipeline as the primary generator.
- Fixes the malformed postal-code padding bug in the published data.
4. Enrichment design
4.1 What StatCan can contribute
Join key is postal_code. Measured overlap between Geonames CA_full and StatCan ODA:
- Overlap: 44,964 postal codes = 5.0% of Geonames, 99.5% of StatCan.
- StatCan codes absent from Geonames: 205 (negligible).
The useful level-2 signal is not in the processed StatCan file (whose admin_name2 = data
provider, admin_code2 = province id). It lives in the raw ODA columns csdname
(Census Subdivision name ≈ municipality) and csduid (Census Subdivision UID). Using it requires
re-parsing the raw ODA zips (~300 MB+ per province) and keeping csdname/csduid.
Scope of StatCan enrichment: fills admin_name2/admin_code2 for ~5% of rows, in 5 provinces
only. It adds essentially no new postal codes.
4.2 Nationwide alternative (recommended primary enrichment)
For admin2 coverage across all of Canada, apply a postal-code → census-subdivision crosswalk
(StatCan Postal Code Conversion File, PCCF, or an equivalent FSA/postal→CSD mapping) to all
900k Geonames codes. This gives one enrichment source at ~100% coverage instead of a 5% patch.
4.3 Layered strategy
- Base: Geonames
CA_full→ all 12 standard fields,admin2/3empty. - Primary enrichment (nationwide): PCCF/CSD crosswalk fills
admin_name2/admin_code2for all rows where a mapping exists. - StatCan supplement (5-province): for the 44,964 overlapping codes, backfill/validate
admin_name2/admin_code2from raw ODAcsdname/csduidwhere PCCF is missing, and add the 205 StatCan-only codes. - Leave
admin_name3/admin_code3,alternative_city_nameempty (no reliable source).
5. Implementation steps
- New parser
scripts/custom_parsing_scripts/canada_geonames_full.py:- Download
https://download.geonames.org/export/zip/CA_full.csv.zip. - Map the 12 Geonames columns to the datahub 13-column schema (append empty
alternative_city_name). - Normalize
postal_codetoA1A 1A1(fixes the0000T0Apadding bug). - Upload to R2 as the
caresource(s).
- Download
- Crosswalk enrichment
scripts/custom_parsing_scripts/canada_admin2_enrich.py:- Load PCCF (or chosen crosswalk); join on postal code; fill
admin_name2/admin_code2. - Fall back to raw-ODA
csdname/csduidfor the 5-province overlap where PCCF is absent.
- Load PCCF (or chosen crosswalk); join on postal code; fill
- Retire the StatCan-only path: remove/disable
run-monthly-canada-postal-codes.ymlas the primary generator (keep the raw-ODA parse only as the supplement in step 2 if used). - Update
datasets/ca/datapackage.yml— description,modified,bytes, and source attribution to reflect GeonamesCA_full+ enrichment. - Regenerate the 100-row sample and
consolidated_statsvia the existing samples/stats job. - Validate with
scripts/custom_parsing_scripts/data_integrity_checker.py(empty/duplicate/format checks) plus coverage assertions (all 13 provinces present, ~900k unique codes).
6. Expected result
| Metric | Before (StatCan) | After (Geonames CA_full + enrichment) |
|---|---|---|
| Unique postal codes | 45,169 | ~899,779 |
| Provinces/territories | 5 | 13 |
| National coverage | ~5% | ~100% |
admin_name2 filled | junk (provider) | crosswalk/CSD, nationwide where mapped |
| Malformed codes | 0000T0A in prod | clean A1A 1A1 |
7. Risks & notes
- Geonames licensing —
CA_fullis under the Geonames license (CC BY). Confirm redistribution terms for the premium/full product before publishing. - PCCF licensing/access — confirm StatCan PCCF redistribution terms; if restricted, fall back
to the raw-ODA
csdnamesupplement (5-province only) and leaveadmin2empty elsewhere. - Coordinate quality — Geonames
CA_fullcoordinates are 100% valid and within the Canada bounding box; the smallCA.zipfile has a few placeholder coords (lat 90 / lon 0) and must not be used as the base. - No StatCan history gain — do not spend effort hunting older StatCan editions; the source gap is structural, not temporal.