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
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
Release history Release notifications | RSS feed
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 nepal_geo_data-0.2.0.tar.gz.
File metadata
- Download URL: nepal_geo_data-0.2.0.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f099bdec3df270c8af8db19b0dafdc96a91e4a44f39d03cb756c65b0e94d2b4a
|
|
| MD5 |
4f9f1067e2936f8306849d090cd335ea
|
|
| BLAKE2b-256 |
f2b27de563225747880523875475466b99811e9b40cf432b0243a1a49d41a10f
|
File details
Details for the file nepal_geo_data-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nepal_geo_data-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7164dde708996349787c1aa5768c2910cd7eb889d75b3293833102bbb40b8e1a
|
|
| MD5 |
8b2c2838637aa18bf94350812c91352a
|
|
| BLAKE2b-256 |
666fc9aaa45b276933afc73507b1e6990e31e0efb27edf2289183b3cb08efd8b
|