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.4.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.4-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nepali_address-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 2be5a628e7db3656a1044170cfd2fb68ade15e4422e7d9969bd8285ea37743d2
MD5 c69e76a7d9d3a373e7cf9405a0f26c95
BLAKE2b-256 fb17921f8fec1a49237281bace399c835a916e38bebe2c5bd1520f8bdad2a02f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nepali_address-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5065a2067be12222cbbe4864a5c334191058176cb2aa1328dc1a1cb512bc6b36
MD5 620cb491658c477ed08ea5c81e14bd87
BLAKE2b-256 2182c63294315283053dffac510f7b1c1fb0897861ce4a253b99e7d219bf8b0b

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