Logo Lanfrica

Xander-AJ/kenya-emergency-api

Domain:

digital infrastructure

Record type:

software
Creator:
Xan
Host:
# kenya-emergency-api > Civic-tech infrastructure for Kenyan emergency contacts, national emergency numbers, and poison control. A Python package and a self-hostable HTTP API, sharing a single verified data layer. When someone in Kenya needs help, the developers building the apps they reach for shouldn't be hardcoding emergency numbers from memory. This is that data layer — vendored, verified, versioned, and free to use. **Status:** v1 in development. The codebase is complete; the verified data is currently being curated against official sources. Until v1.0 ships, the package contains structure and fixtures but no production emergency contacts. ## What you get - 47 Kenyan counties with codes, capitals, and regional metadata - Per-county emergency contacts: police, fire, ambulance, Red Cross, GBV helpline, child helpline - National emergency numbers (999, 911, 112, 1199, 1195, 116) - Poison control centers - Every record carries explicit provenance — source, verification method, last-verified date - Phone numbers normalized to E.164 via libphonenumber Hospital and facility data is **not** included in v1. That's planned for v1.1, where it will be added with the same provenance discipline rather than dumped in raw from KMHFL exports. ## Two ways to use it ### As a Python package ```python from kenya_emergency import EmergencyService, ContactCategory service = EmergencyService() # auto-builds local SQLite from bundled snapshots # Look up a county (accepts "47" or "047") nairobi = service.county("47") # Get fire brigade contacts for that county fire = service.contacts_for_county("047", category=ContactCategory.FIRE) # Composite use case: everything for one place overview = service.emergency_overview("Nairobi") ``` ### As an HTTP API (self-host) ```bash pip install kenya-emergency uvicorn kenya_emergency.api.app:app --port 8000 ``` ```bash curl localhost curl localhost cur …

Licenses