API package containing all regions of Rwanda from provinces to villages.
Project description
Rwanda Locations API
A Python package and FastAPI-based API providing comprehensive administrative location data for Rwanda — from provinces down to villages.
Features
- Access Rwanda’s administrative hierarchy:
- Provinces
- Districts
- Sectors
- Cells
- Villages
- Easy-to-use Python package for integration in your projects.
- Ready-to-use FastAPI endpoints for quick REST API deployment.
- Location names are case-insensitive for better usability.
Installation
pip install rwanda-locations-api
Usage
from rwanda_locations_api.locs import get_provinces, get_districts, get_sectors, get_cells, get_villages
# Get all provinces
provinces = get_provinces()
print(provinces)
# Get districts in a province
districts = get_districts("Kigali")
print(districts)
# Get sectors in a district
sectors = get_sectors("Kigali", "Gasabo")
print(sectors)
# Get cells in a sector
cells = get_cells("Kigali", "Gasabo", "Kimironko")
print(cells)
# Get villages in a cell
villages = get_villages("Kigali", "Gasabo", "Kimironko", "Nyarutarama")
print(villages)
As a FastAPI service
uvicorn main:app --reload
Available end-points
GET /provinces
GET /districts/{province}
GET /sectors/{province}/{district}
GET /cells/{province}/{district}/{sector}
GET /villages/{province}/{district}/{sector}/{cell}
Development
git clone https://github.com/itbienvenu/rwanda-location-api.git
cd rwanda-location-api
Create virtual environment and install dependencies
python -m venv .venv
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
pip install -r requirements.txt
Then run FASTAPI server
uvicorn main:app --reload
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check issues or submit a pull request.
Author
MWIMULE Bienvenu
GitHub: @itbienvenu
Email: mwimulebienvenu05@gmail.com
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 Distributions
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 rwanda_locations_api-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rwanda_locations_api-0.1.1-py3-none-any.whl
- Upload date:
- Size: 73.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bab26b261e16988a5940ab1c234c8431962481394a59a0f90e1deb32c805545
|
|
| MD5 |
f2c8cebb375768ab8d560ed5a815ef21
|
|
| BLAKE2b-256 |
0b2472e8f60c67bb85566769d5747d201fb66a1dd7b1e70fa703dbaf7d8ee438
|