PHPackages                             yasseralsamman/saudi-municipal-coding - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. yasseralsamman/saudi-municipal-coding

ActiveLibrary

yasseralsamman/saudi-municipal-coding
=====================================

Open dataset of Saudi Arabia's regions, cities, and districts from the MOMRAH Unified Municipal Coding — bilingual lookups with stable IDs.

v1.0.0(1mo ago)04MITTypeScriptPHP ^8.1CI passing

Since Jul 12Pushed 1mo agoCompare

[ Source](https://github.com/yasseralsamman/saudi-municipal-coding)[ Packagist](https://packagist.org/packages/yasseralsamman/saudi-municipal-coding)[ RSS](/packages/yasseralsamman-saudi-municipal-coding/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Saudi Unified Municipal Coding — Open Dataset
=============================================

[](#saudi-unified-municipal-coding--open-dataset)

Open, bilingual dataset of Saudi Arabia's administrative hierarchy — **13 regions, 15,513 cities, and 21,235 districts** — from the MOMRAH Unified Municipal Coding. Every record has Arabic and English names and stable integer IDs linked by foreign keys.

This is a **lookup (coding) dataset**: no coordinates, no boundaries, no composite IDs.

What's in this repo
-------------------

[](#whats-in-this-repo)

- `data/source/` — the canonical JSON (`regions.json`, `cities.json`, `districts.json`).
- `data/dist/` — generated outputs (JSON, CSV, MySQL, PostgreSQL); regenerated by the build.
- `packages/js/` — the `saudi-municipal-coding` npm package.
- `packages/php/` — the `yasseralsamman/saudi-municipal-coding` Composer package.
- `schemas/` — JSON Schema for each entity.
- `scripts/` — the build, validate, and stats pipeline.

Data formats
------------

[](#data-formats)

FormatFilesJSON`data/dist/{regions,cities,districts}.json`CSV`data/dist/{regions,cities,districts}.csv`MySQL`data/dist/mysql.sql`PostgreSQL`data/dist/postgres.sql`SQLite`saudi-municipal-coding.sqlite` (attached to each GitHub Release)Install
-------

[](#install)

### JavaScript / TypeScript

[](#javascript--typescript)

```
npm install saudi-municipal-coding
```

```
import { regions, cities, districts, findDistrict, districtsInCity } from 'saudi-municipal-coding';

regions.length;   // 13
cities.length;    // 15513
districts.length; // 21235

findDistrict(2510);     // { district_id, city_id, region_id, name_ar, name_en }
districtsInCity(17743); // districts of a city
```

### PHP

[](#php)

```
composer require yasseralsamman/saudi-municipal-coding
```

```
use SaudiMunicipalCoding\Dataset;

Dataset::findRegion(1)?->name_en;   // 'Riyadh'
Dataset::districtsInCity(17743);    // districts of a city (keyed by district_id)
```

The data model
--------------

[](#the-data-model)

`region_id`, `city_id`, and `district_id` are independent integers. Cities reference a region; districts reference both a city and a region, and a district's `region_id` always equals its city's region. District names are not unique by themselves — `district_id` is the unique key. See [`DATA_REFERENCE.md`](DATA_REFERENCE.md) for the full dictionary.

What's not included
-------------------

[](#whats-not-included)

- Geographic coordinates or boundary polygons.
- Population, region codes, or capital cities.
- Composite/encoded identifiers — the IDs here are plain integers.

Development
-----------

[](#development)

```
pnpm install
pnpm run validate   # integrity checks on data/source
pnpm run build      # regenerate data/dist + package data
pnpm run stats      # counts + file sizes
pnpm test           # JS + PHP package tests
pnpm run lint       # Biome
```

`data/dist/` and `packages/*/data/` are committed; CI rebuilds and fails if they drift from a fresh build (`pnpm run check:dist-clean`). See [`CONTRIBUTING.md`](CONTRIBUTING.md).

License
-------

[](#license)

- **Code** (scripts, both packages): [MIT](LICENSE).
- **Data** (`data/source/` and `data/dist/`): [CC0-1.0](LICENSE-DATA) — a public-domain dedication, so no attribution is required.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

50d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/220514259?v=4)[yassersamman](/maintainers/yassersamman)[@yassersamman](https://github.com/yassersamman)

---

Top Contributors

[![yasseralsamman](https://avatars.githubusercontent.com/u/10357655?v=4)](https://github.com/yasseralsamman "yasseralsamman (2 commits)")

---

Tags

lookupcitiesregionssaudi-arabiadistrictssaudimunicipalmomrah

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yasseralsamman-saudi-municipal-coding/health.svg)

```
[![Health](https://phpackages.com/badges/yasseralsamman-saudi-municipal-coding/health.svg)](https://phpackages.com/packages/yasseralsamman-saudi-municipal-coding)
```

###  Alternatives

[pragmarx/countries

PHP Countries and Currencies

1.9k3.5M27](/packages/pragmarx-countries)[io-developer/php-whois

PHP WHOIS provides parsed and raw whois lookup of domains and ASN routes. PHP 5.4+ and 7+ compatible

4972.9M18](/packages/io-developer-php-whois)[nnjeim/world

Laravel countries, states, cities, currencies, languages and IP geolocation

991561.7k8](/packages/nnjeim-world)[pragmarx/countries-laravel

Countries for Laravel

1491.1M2](/packages/pragmarx-countries-laravel)[igaster/laravel_cities

Seed all countries/cities from geonames.org database. Searchable DB tree, ready to use API &amp; a bonus vue.js component!

18096.1k1](/packages/igaster-laravel-cities)[gerardojbaez/geodata

Laravel 5.2 package that provides basic geographical data like Countries, Regions and Cities.

3112.0k](/packages/gerardojbaez-geodata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
