Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

rwanda_locations_api-0.1.1-py3-none-any.whl (73.8 kB view details)

Uploaded Python 3

File details

Details for the file rwanda_locations_api-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rwanda_locations_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bab26b261e16988a5940ab1c234c8431962481394a59a0f90e1deb32c805545
MD5 f2c8cebb375768ab8d560ed5a815ef21
BLAKE2b-256 0b2472e8f60c67bb85566769d5747d201fb66a1dd7b1e70fa703dbaf7d8ee438

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