Postal Codes Dataset for Morocco, MA

286
Updated:
Files:1
Size:105 kB
Rows:1,325
Formats:csv
License:CC-BY-4.0

Postal Codes Dataset for Morocco, MA 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
  • Creative Commons Attribution 4.0 International license
20% off
$49.90$39.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-ma/
https://datahub.io/logistics/postal-codes-ma/_r/-/.licensing-notes.md
https://datahub.io/logistics/postal-codes-ma/_r/-/.migration-notes.md
https://datahub.io/logistics/postal-codes-ma/_r/-/ATTRIBUTION.txt
https://datahub.io/logistics/postal-codes-ma/_r/-/README.md
https://datahub.io/logistics/postal-codes-ma/_r/-/datapackage.yaml
Key Files

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

datapackage.yaml— metadata & schema
https://datahub.io/logistics/postal-codes-ma/_r/-/datapackage.yaml
README.md— documentation
https://datahub.io/logistics/postal-codes-ma/_r/-/README.md
Typical Usage
  1. 1. Fetch datapackage.yaml to inspect schema and resources
  2. 2. Download data resources listed in datapackage.yaml
  3. 3. Read README.md for full context

Data Files

postal-codes-ma-sample

About

Last updated
2 October 2026
Total rows
100
Format
CSV
File size
9.2 kB

About this dataset

Morocco (MA): migration notes

Internal record of the P5 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 in the zip.

  • Issue: pc-28e.7.33 (closed 2026-10-02)
  • Commit: fa6bf5e (worktree commit 2aa1d3a, identical diff), landed in batch 2; accuracy wording later changed in 5311ad3
  • Parity verdict: format-only (gate pass)
  • Producer: custom, refresh disabled

Sources

InputURLNotes
GeoNames postal exporthttps://download.geonames.org/export/zip/MA.zipThe only input the old builder used

The Barid Al-Maghrib 2018 reference on data.gov.ma is ODbL and is not used (per .licensing-notes.md).

Parity against the live zip (2026-10-02)

Rows: 1,325 live and 1,325 fresh, none only on one side, 0 changed cells. No content classes, so no row_order. The only difference is line endings: live is 105,845 bytes and fresh 104,519, exactly 1,326 bytes less, one per line (CRLF→LF). The informational sample check was also format-only.

Decisions

DecisionByBasis
Land with CRLF→LF as the only differenceGate (format-only passes without sign-off)Recorded under batch 2 in docs/parity/p5.md
Keep admin_code2 unprefixedAgent: a faithful portIt is a GeoNames-internal id; ISO 3166-2:MA stops at regions
Carry Western Sahara rows through unchangedAgent: a faithful portAs the old builder did; disclosed in ATTRIBUTION.txt
Remove row, distinct-code and collision counts from README and descriptor; replace the stale licence_status.decision sentence; standard accuracy descriptionOrchestrator instruction (P5 brief)Kept "12/12 regions" and "59 distinct provinces/prefectures" (still matches the fresh data)
Accuracy description says GeoNames documents 1/4/6 and other values (e.g. 3) occur upstreamOrchestrator (5311ad3, all batch-2 descriptors)Reported to the user with batch 2; the user replied "agree to all" (session 2479b1c9)

Transforms carried over

From build_postal_codes_product.py (2026-09-17 audit):

  • Cells read verbatim with csv, never pandas: admin_name3 / admin_code3 stay empty instead of the literal "nan", and admin_code1 / admin_code2 keep their leading zeros.
  • admin_code1 → ISO 3166-2:MA by adding MA- (GeoNames' 01–12 already are the ISO codes).
  • alternative_city_name empty.
  • The old asserts are ProducerErrors: 5-digit postal codes, known region code, 3-digit admin_code2, admin3 blank upstream, all 12 regions present, unique (postal_code, place_name). No row-count assert.
  • build_postal_codes_product.py and publish_r2.py removed.

Open questions

  • ATTRIBUTION.txt ("1,325 rows") and .licensing-notes.md still carry counts; left for the end-of-epic sweep (pc-hfz, which subsumes pc-3d2).

Provenance

Reconstructed 2026-10-05 from the agent transcript 2479b1c9-c4dd-47e5-be82-34ccf8d49a80/subagents/agent-a894ea92a472789b8.jsonl, the orchestrator session 2479b1c9-…, the commit messages (fa6bf5e, 5311ad3), the bd close reason and docs/parity/p5.md.