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.0.tar.gz (26.6 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.0-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nepali_address-0.1.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nepali_address-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d9f663d25ffa813c6486ab39b77b14932f8d2150b4f07db3f05bc3b9741134d0
MD5 5e7dc7042bad8273509e07802708bf2f
BLAKE2b-256 11edb8194cd44ff31063aa3a577fa65cf4bcee1cd38f29c3c6545bdec3a7f5d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nepali_address-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nepali_address-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cec616f292ee8f3eff7acb64fe09989b097e21c794552656d87a489cad2592a
MD5 469d3900d7c367d18aeb40ca6b569c82
BLAKE2b-256 a95309cf7b2c7046e70bda1817460e2a82a1d2705426a882f81f5e28e60fdb03

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