Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

NepalData

NepalData is a PHP library for looking up Nepal’s provinces, districts, and local levels. It runs in standalone PHP and integrates with Laravel through package discovery, a facade, and dependency injection.

Included in each languageRecords
Provinces7
Districts77
Metropolitan cities6
Sub-metropolitan cities9
Municipalities259
Rural municipalities447
Total local levels721

The data is bundled in English and Nepali. Once installed, NepalData needs no network requests, database, migrations, or package configuration. Use it to populate address forms, list local levels for a selected district, check relationships, or supply localized names to a user interface.

The typed API exposes read-only records and chainable queries. For example, this gets the names of rural municipalities in Kaski:

use KodeFarmers\NepalData\Entities\District;
use KodeFarmers\NepalData\NepalData;

$data = new NepalData();
$names = $data->localLevels()
    ->whereDistrict(District::KASKI)
    ->ruralMunicipalities()
    ->orderByName()
    ->names();

This guide covers v2.0.0 of kodefarmers/nepaldata. Start with installation and the quick start, or jump directly to the public API. If you’re replacing a v1 installation, see the upgrade guide for how to preserve existing array responses.

The bundled records are a snapshot, and package IDs are not official government codes. Read Data Sources and Limitations before using the package where official completeness or current administrative boundaries matter.