A Python package for Nepali address data (Provinces, Districts, Local Levels)
Project description
nepali-address
A Python package for retrieving geographical data of Nepal, including Provinces, Districts, and Local Bodies (Municipalities/Rural Municipalities). This package is a Python port of the nepali-address TypeScript library.
Installation
pip install nepali-address
Usage
Provinces
from nepali_address import get_provinces, get_province_by_id
# Get all provinces
provinces = get_provinces()
# Get province by ID
province = get_province_by_id(3)
# {'id': 3, 'name': 'Bagmati Province', 'name_ne': 'बागमती प्रदेश', ...}
Districts
from nepali_address import get_districts, get_district_by_name, get_districts_by_province
# Get all districts
districts = get_districts()
# Get district by name (auto-normalizes input)
kathmandu = get_district_by_name('Kathmandu')
# Get districts in a province
bagmati_districts = get_districts_by_province(3)
Local Levels (Municipalities)
from nepali_address import get_local_levels, get_local_levels_by_district
# Get all local levels (753 total)
all_local_levels = get_local_levels()
# Get local levels in Kathmandu
ktm_local_levels = get_local_levels_by_district(306)
Features
- Standardized Data: Contains all 7 provinces, 77 districts, and 753 local bodies.
- Fast Lookup: Uses internal mapping for O(1) lookups by ID, Name, and Postal Code.
- Normalization: Handles input variations (e.g., "Kathmandu", "kathmandu", "Bagmati Province" vs "Bagmati").
- Zero Dependencies: Pure Python implementation with no external requirements.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nepali_address-0.1.3.tar.gz.
File metadata
- Download URL: nepali_address-0.1.3.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b70d3bc7a986ef94521f88cf00d614c0fe9551257931fd95a6c84be7aaa26417
|
|
| MD5 |
fcd6ef67588f852a80ffcaaaddd736cf
|
|
| BLAKE2b-256 |
bd57945989f6eef6e48b47f3ebb7efea9db59414da5bc8764fc3432be233ac59
|
File details
Details for the file nepali_address-0.1.3-py3-none-any.whl.
File metadata
- Download URL: nepali_address-0.1.3-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b47229b4d70ebc8376c9cf1d66e878885db1da0e1f169702b71744bb309e683
|
|
| MD5 |
8ea6a4b91ec7d8589e631e765a0cec63
|
|
| BLAKE2b-256 |
907664d1aa6fb6a21f45f52db4cb7672781713898dcdbbe216afce424444c9d4
|