Skip to main content

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

nepali_address-0.1.2.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nepali_address-0.1.2-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file nepali_address-0.1.2.tar.gz.

File metadata

  • Download URL: nepali_address-0.1.2.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

Hashes for nepali_address-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8c37f2a9077abddde1289cbfa07351b3c6aec345ce0e6d197af219d54050cabd
MD5 5c95f9e5bc5c5bbeb8cfe73463245632
BLAKE2b-256 eb2723f83bb793668b898274f8610ca2f6750068d1fcef6dc0f257efa26d8408

See more details on using hashes here.

File details

Details for the file nepali_address-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: nepali_address-0.1.2-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

Hashes for nepali_address-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb83a47f47326a2e2f27bca009c9fd08b07a5349ac19339474d547b80d9c2969
MD5 636f658b698acf5686e4252e093ae701
BLAKE2b-256 206d571f59a642b95adfda69acab27f20a0489f53447fc4999af177548654645

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page