Skip to main content

Rwanda administrative hierarchy dataset and query helpers.

Project description

Rwanda Admin Hierarchy (Python)

Python package for querying Rwanda administrative hierarchy data:

Country -> Province -> District -> Sector -> Cell -> Village

Source of Information

This package is built from:

  • Guidence.md
  • List_of_Villages_for_all_technology.pdf

Install (local)

pip install .

Run from the python directory.

Usage

from rwanda_admin import (
    get_dataset,
    get_provinces,
    get_districts_by_province_id,
)

dataset = get_dataset()
provinces = get_provinces()
districts = get_districts_by_province_id("province-umujyi-wa-kigali")

FastAPI integration

pip install "rwanda-admin[fastapi]"
from fastapi import FastAPI
from rwanda_admin.integrations.fastapi import create_router

app = FastAPI()
app.include_router(create_router(), prefix="/api/rwanda")

Django integration

pip install "rwanda-admin[django]"
# urls.py
from django.urls import include, path

urlpatterns = [
    path("api/rwanda/", include("rwanda_admin.integrations.django")),
]

Both integrations expose the same read-only endpoints relative to the mount point: meta, provinces, provinces/<id>/districts, districts/<id>/sectors, sectors/<id>/cells and cells/<id>/villages. List responses omit child collections so they stay small enough for dropdowns; unknown ids return HTTP 404.

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

rwanda_admin-1.4.1.tar.gz (166.7 kB view details)

Uploaded Source

Built Distribution

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

rwanda_admin-1.4.1-py3-none-any.whl (176.6 kB view details)

Uploaded Python 3

File details

Details for the file rwanda_admin-1.4.1.tar.gz.

File metadata

  • Download URL: rwanda_admin-1.4.1.tar.gz
  • Upload date:
  • Size: 166.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rwanda_admin-1.4.1.tar.gz
Algorithm Hash digest
SHA256 d46dc932ab303d4057e0c65c0fb338db41db36ff88a280f4d12b510b5056e4d5
MD5 ddff0c69ca00b27fec98d8f73e4ae03b
BLAKE2b-256 528925a78c23d46e9f42d1623e5b84ed6e91d43b4b714e2f09529d2d0dadfdae

See more details on using hashes here.

File details

Details for the file rwanda_admin-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: rwanda_admin-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 176.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rwanda_admin-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7f229b37a1cf8017053ee07ba5ce054f785e8bb9f9a1c8f2ccfaea1f8c779b0
MD5 190596fd752e1dda034619fbaff07915
BLAKE2b-256 f009a8c1fe187be21a699c9ded016c8d0560d6a849e0a9e331a123d122f36129

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