Rwanda Administrative Hierarchy API is a structured data and service project that models the full administrative system of Rwanda in a consistent, machine-readable format. It organizes the hierarchy from country level down to villages, following the official structure: Country → Province → District → Sector → Cell → Village.
# Rwanda Administrative Hierarchy API
This project provides a structured dataset and API for Rwanda administrative levels:
`Country -> Province -> District -> Sector -> Cell -> Village`
**5 provinces · 30 districts · 416 sectors · 2,142 cells · 14,816 villages** —
sourced from the official NISR "List of Villages", with NISR codes at every
level, ISO 3166-2 province codes, name search, and address validation.
Available for Node.js,
Python, Java (GitHub
Packages), and Flutter (`dart/`), plus CSV/SQL/SQLite exports on every release.
The code is ISC-licensed; the dataset is licensed CC BY 4.0.
Wrong or missing place? Please
open a data-correction issue — local knowledge keeps
this dataset trustworthy. See CONTRIBUTING.md.
## Install
```bash
npm install rwanda-admin
# or
yarn add rwanda-admin
# or
pnpm add rwanda-admin
```
All three commands install the same package from the npm registry.
The published package is a **zero-dependency** data library with bundled TypeScript
type definitions. The Express API server described below is a development/deployment
extra and its dependencies are only installed when working inside this repository.
## Information Source
All data structure, rules, and implementation behavior in this project are based on these two repository documents:
- `Guidence.md` (implementation guidance and system rules)
- `List_of_Villages_for_all_technology.pdf` (primary administrative data source used to build the JSON dataset)
No external assumptions are required to run or use this project.
## What This Project Contains
- `data/rwanda-administrative.json`
Generated hierarchical dataset.
- `src/server.js`
Express API server with endpoints by hierarchy level.
- `src/data-store.js`
Loads and caches JSON once in memory.
- `scripts/build-json-from-pdf.js`
Rebuilds JSON dataset from the provided PDF.
- `scripts/validate-data.js`
Checks integrity rules (IDs, structure, duplicates within level).
- `TECHNICAL_DOCUMENTATION.md`
Full technical explanati …