Python SDK for building civic AI tools in East Africa โ parliament, budgets, drought, M-Pesa, MCP and A2A
Project description
๐ ๏ธ CivicAgentKit โ East African Civic AI SDK
The unified Python toolkit for building civic AI tools in East Africa. One install gives you access to Kenya's parliament records, county budgets, NDMA drought data, M-Pesa payments, and both MCP and A2A protocol integrations.
Install
pip install civic-agent-kit
What's included
from civic_agent_kit import (
# Data loaders โ Kenya's public civic datasets
KenyaBudgetData, # Controller of Budget โ 47 counties
KenyaParliamentData, # MPs, bills, CDF โ 13th Parliament
KenyaSACCOData, # SASRA SACCO registry
KenyaDroughtData, # NDMA drought phases
# Agents
BudgetAgent, # County budget analysis (CrewAI)
RightsAgent, # Constitutional rights Q&A (EN/SW)
DroughtAgent, # Drought + SMS alert agent
# Protocols
KenyaMCPServer, # MCP server โ wraps all Kenya data as MCP tools
KenyaA2AServer, # A2A server โ Kenya civic skills for agent-to-agent
# Utils
KenyaCounties, # All 47 county codes + names
KiswahiliTranslator, # Simple civic term translations ENโSW
)
Quick examples
Load county budget data:
from civic_agent_kit import KenyaBudgetData
budgets = KenyaBudgetData.load()
low_absorption = budgets[budgets['absorption_rate'] < 0.5]
print(low_absorption[['county', 'allocation_kes_m', 'absorption_rate']])
Serve Kenya civic data as an A2A agent:
from civic_agent_kit import KenyaA2AServer
server = KenyaA2AServer(host="http://localhost:8000")
server.run() # exposes /.well-known/agent.json + JSON-RPC endpoint
Serve as an MCP server:
from civic_agent_kit import KenyaMCPServer
# Run alongside mpesa-mcp for full East African AI stack
server = KenyaMCPServer()
server.run()
Ask a rights question in Kiswahili:
from civic_agent_kit import RightsAgent
agent = RightsAgent(language="sw")
answer = agent.ask("Haki yangu ya ardhi ni nini?")
print(answer)
# โ "Kifungu 40: Kila mtu ana haki ya kupata na kumiliki mali..."
The East African AI Stack
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your AI Agent โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโผโโโโโโโ โโโโโโโโโผโโโโโโโ
โ MCP Layer โ โ A2A Layer โ
โ (tools) โ โ (agents) โ
โโโโโโโโฌโโโโโโโโ โโโโโโโโโฌโโโโโโโ
โ โ
โโโโโโโโโโโดโโโโโโโโโโโ โโโโโโโโโโโโดโโโโโโโโโโ
โ โ โ โ
โโโโโโผโโโโโ โโโโโโโโผโโโโโโ โโโโโโโโโผโโโโโ โโโโโโโโผโโโโโโโ
โmpesa-mcpโ โKenyaMCP โ โkenya-a2a โ โCivicAgent โ
โpayments โ โcivic data โ โparliament โ โKit agents โ
โSMS โ โbudgets โ โbudgets โ โbudget/rightsโ
โairtime โ โparliament โ โdrought โ โdrought โ
โโโโโโโโโโโ โโโโโโโโโโโโโโ โrights EN/SWโ โโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโ
Data
All data from the Kenya Civic Datasets (CC BY-SA 4.0):
- Kaggle: gmahia/kenya-civic-data โ DOI:
10.34740/kaggle/dsv/15473045 - HuggingFace: gmahia/kenya-civic-data โ DOI:
10.57967/hf/8223
Related packages
| Package | Description | PyPI |
|---|---|---|
mpesa-mcp |
M-Pesa + Africa's Talking MCP server | |
civic-agent-kit |
This package |
Full portfolio
13 deployed civic apps: gabrielmahia.github.io
IP & Collaboration
ยฉ 2026 Gabriel Mahia ยท contact@aikungfu.dev License: MIT
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 civic_agent_kit-0.1.0.tar.gz.
File metadata
- Download URL: civic_agent_kit-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7bfc5d86866923087b064db09d57ed87ae9e54e08635ca4263e2be1bd78cb2b
|
|
| MD5 |
7d12756553ecf1fde0228c7881f746a9
|
|
| BLAKE2b-256 |
c5da703ba0c632040cb761782df228eb256ffd18dd1d1985c0e9f3b515ce5e27
|
File details
Details for the file civic_agent_kit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: civic_agent_kit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
620a15a9fd23786b91ea4d73d190e6c524b8a7601dc16a138cc3577511eeabe9
|
|
| MD5 |
a27f416378a71c96c2f1a49498930b2c
|
|
| BLAKE2b-256 |
24938b3a4422553af5c24d6c23f8a085fba17ae065d28807c4117dd2c8d1bd7d
|