Postal Codes Dataset for Brazil, BR

615
0
Updated:
Files:1
Size:8.98 kB
Formats:csv
License:MITCC-BY-4.0

Postal Codes Dataset for Brazil, BR including name of the city, town, or place, various administrative divisions and alternative city names.

Part of a Data Solution

  • Postal Codes Solution

    Every worldwide postal-code dataset in one bundle — the ultimate global reference for precise postal codes.

    Explore →

Premium

You're viewing a free sample

Get the complete dataset — all rows and files — delivered instantly after checkout, with lifetime access to the latest version.

  • Secure checkout via Stripe
  • Instant download after payment
  • Lifetime access to the latest version
  • MIT License license
20% off
$99.90$79.92
one-time payment

API Access

Access dataset files directly from scripts, code, or AI agents.

Browse dataset files
Dataset Files

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.

/logistics/postal-codes-br/
https://datahub.io/logistics/postal-codes-br/_r/-/.licensing-notes.md
https://datahub.io/logistics/postal-codes-br/_r/-/README.md
https://datahub.io/logistics/postal-codes-br/_r/-/datapackage.yml
Key Files

Start with these files — they give you everything you need to understand and access the dataset.

datapackage.ymlmetadata & schema
https://datahub.io/logistics/postal-codes-br/_r/-/datapackage.yml
README.mddocumentation
https://datahub.io/logistics/postal-codes-br/_r/-/README.md
Typical Usage
  1. 1. Fetch datapackage.yml to inspect schema and resources
  2. 2. Download data resources listed in datapackage.yml
  3. 3. Read README.md for full context

Data Files

Postal Codes Data Resource for Brazil, BR


About this dataset

Brazil (BR) — internal licensing notes

Not mentioned in datahub-next#941 — no known licensing flag on this country from that issue, but it has its own real, disclosed licensing caveat found independently this session (below) — worth cross-referencing against #941's general framework (a scraped-source-with-no-stated-licence risk, same shape as several items in #941 §2/§3).

Sources and licences

  • SeuAliado/OpenCEP (MIT) — primary bulk CEP data. Confirmed via the repo's own LICENSE file; actively maintained (updated the same week this was checked), 401 stars.
  • Mendeley Data, "Códigos de CEP do Brasil por UF, CIDADE, BAIRRO E LOGRADOURO" by Ivan Zimmermann (CC BY 4.0, confirmed via the dataset page) — secondary CEP data, consolidated for coverage. Data current through 2018.
  • IBGE Localidades API — official Brazilian government admin reference.
  • kelvins/municipios-brasileiros (MIT) — municipality dictionary.
  • ruacep.com.br scrape (~7,000 of 1,233,231 rows) — no stated data-reuse licence. The site is copyrighted ("todos os direitos reservados") with no published reuse terms, confirmed by direct check of its footer/ToS links. This slice cannot be cleanly separated back out of the already-merged dataset without re-deriving from the other four sources individually. Disclosed as a residual, non-blocking risk in research.json and the shipped README — a human decision on whether to accept, exclude, or force a re-derivation is still open.

Given this shape — a multi-source consolidation with one real unresolved licensing caveat on part of the data — this is priced Tier A ($99) per docs/PRICING_TIERS.md's own decision rule, the same category as Canada's pre-#941 situation (base + crosswalk + a licensing caveat no other field carries).

Session finding, 2026-08-19

The real generator script (brazil_postal_code_parse.py) only ever existed in a separate repo (datopian/Fedex-dataset), never committed to either repo touched this session — pulled in along with its two small archive dependencies specifically so this repo doesn't depend on that other repo surviving. Verified the postal-codes-product conversion is SHA256-identical to what's live on R2: 1,233,231 rows (the one postalCode "00000" backfill row, a municipality with no CEP in any source, correctly excluded — this product is a list of postal codes).

Two live-fetch reliability bugs found and fixed in the generator script itself while re-running it self-contained (network issues, unrelated to the licensing question): Mendeley's Cloudflare front 403s requests/urllib3 via TLS fingerprinting regardless of User-Agent header; the 342MB OpenCEP zip has no retry/resume in requests (a single dropped connection loses the whole download). Both switched to curl.

This session's self-containment fix was validated statically, not via a second full live re-fetch (the OpenCEP download proved unreliable over this connection even with retries) — the underlying transformation logic is unchanged from the version that WAS already verified SHA256-identical earlier the same day; only paths and fetch-reliability code changed. See scripts/README.md for the full reasoning.

CLOSED — 2026-08-24 (datahub-next#941 §4)

Added standalone br/ATTRIBUTION.txt mirroring the README's existing "Data Sources" section (SeuAliado/OpenCEP MIT, Mendeley Data CC BY 4.0, IBGE official, kelvins/municipios-brasileiros MIT, plus the ruacep.com.br chain-of-title caveat) — now in R2 and inside br.zip. build_postal_codes_product.py updated to write and zip it, publish_r2.py updated to upload it, on every run. _meta/catalog.json's BR entry rebuilt to include it. No pre-existing defect found.