Skip to main content

Comprehensive Python package offering Nepal's geographical data including GeoJSON for all 77 districts and 7 provinces. Ideal for GIS, mapping, and data visualization projects for Nepal.

Project description

Nepal Geo Data: Python Package for Nepal's Geographical GeoJSON

PyPI version License: MIT

Nepal Geo Data is a complete, lightweight Python package designed for GIS developers, data scientists, and researchers who need accurate and easy-to-access geographical properties for Nepal. It bundles high-quality GeoJSON data for all 77 Districts and 7 Provinces, eliminating the need to search for clean map data files.

Whether you are building a dashboard in Streamlit, analyzing spatial data with Pandas/GeoPandas, or creating interactive maps with Plotly/Folium, this package provides the map data you need with a simple API.

Key Features

  • Complete Coverage: Includes GeoJSON for all 77 districts and 7 provinces.
  • Zero Dependencies: Works with standard Python libraries; perfect for lightweight environments.
  • Developer Friendly: Simple functions to get district lists, boundaries, and province hierarchies.
  • GIS Ready: Outputs standard FeatureCollections compatible with GeoPandas (gpd.read_file), Folium, and Plotly.
  • Searchable: Case-insensitive lookup for districts (e.g., "Kathmandu", "Lalitpur").

Installation

Install via pip from PyPI:

pip install nepal-geo-data

Quick Start Guide

1. Retrieve List of Nepal Districts

Get a sorted list of all 77 districts. This is useful for creating dropdown menus or validation lists in your applications.

import nepal_geo_data

# Get all district names
districts = nepal_geo_data.get_districts()
print(districts)
# Output: ['ACHHAM', 'ARGHAKHANCHI', ..., 'UDAYAPUR']

2. Get District Maps & Coordinates

Fetch the full GeoJSON Feature for a specific district. This includes the polygon geometry (coordinates) and metadata (Headquarters, Province ID).

# Search for a district (Case Insensitive)
ktm = nepal_geo_data.get_district("Kathmandu")

if ktm:
    print(f"Headquarters: {ktm['properties']['HQ']}")
    print(f"Province: {ktm['properties']['PROVINCE']}")
    # ktm['geometry'] contains the Polygon coordinates for plotting

3. Filter Districts by Province

Easily group districts. For example, find all districts in Bagmati Province (Province 3).

# Get districts in Province 3 (Bagmati)
bagmati_districts = nepal_geo_data.get_province_districts(3)
print(bagmati_districts)

Integration Examples for Data Science

Using with Plotly Express (Interactive Maps)

This package integrates seamlessly with Plotly to create stunning choropleth maps of Nepal.

import plotly.express as px
from nepal_geo_data import get_geojson

# Load the full GeoJSON Data
nepal_geojson = get_geojson()

# Dummy data for visualization
data = {'District': ['KATHMANDU', 'LALITPUR', 'BHAKTAPUR'], 'Value': [100, 80, 60]}

fig = px.choropleth_mapbox(
    data_frame=data,
    geojson=nepal_geojson,
    locations='District',
    featureidkey="properties.DISTRICT",
    color='Value',
    center={"lat": 28.3949, "lon": 84.1240},
    mapbox_style="carto-positron",
    zoom=6,
    title="Nepal District Density Map"
)
fig.show()

Contributing

We welcome contributions! If you have improved GeoJSON data or new features for Nepal's geography analysis, please check out our repository.

GitHub Repository: https://github.com/bedbyaspokhrel/nepal-geo-data

Local Development

git clone https://github.com/bedbyaspokhrel/nepal-geo-data.git
cd nepal-geo-data
pip install -e .

License

This project is licensed under the MIT License - see the LICENSE file for details.


Keywords: Nepal GIS, Nepal Map Python, GeoJSON Nepal, Nepal Districts Data, Kathmandu Map, Nepal Provinces JSON, Python GIS Nepal.

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

nepal_geo_data-0.1.3.tar.gz (549.6 kB view details)

Uploaded Source

Built Distribution

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

nepal_geo_data-0.1.3-py3-none-any.whl (545.9 kB view details)

Uploaded Python 3

File details

Details for the file nepal_geo_data-0.1.3.tar.gz.

File metadata

  • Download URL: nepal_geo_data-0.1.3.tar.gz
  • Upload date:
  • Size: 549.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nepal_geo_data-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5e2e80341e134451e15cdb8b44b16cb07dbe725bd4a7f4ce18494a71dd6e8898
MD5 52820284fe165dcff8afa4d3e2430048
BLAKE2b-256 f71ed5b01159d9b5c54a16e7c8f5ff74ce6a3dbc006adc576eff0f64925a819b

See more details on using hashes here.

File details

Details for the file nepal_geo_data-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: nepal_geo_data-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 545.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nepal_geo_data-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e9031b2d912d19ec571470357e18e4822277735d0b62e241dc6c0549f5f0d47e
MD5 31b8de431dee3f6ab5d5cb3738ac290f
BLAKE2b-256 129091260f39dcbbaddbbe2f25ea5a2f874c3d846da6fa5b2c3a9ec3f2cc4b26

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