Registry / messaging / africastalking

africastalking

JSON →
library2.0.2pypypi✓ verified 79d ago

Official Python SDK for Africa's Talking APIs (SMS, voice, USSD, airtime, payments, etc.). Current version 2.0.2, requires Python >=3.8. Active development with monthly releases.

pip install africastalking
INSTALL
IMPORT
SIG · AFRICASTALKING
A
africastalking
messagingpythonv2.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

initialize
from africastalking import initialize
import africastalking

Initialize SDK, send an SMS. Replace username and api_key with production credentials.

import os import africastalking username = 'sandbox' api_key = os.environ.get('AT_API_KEY', '') ata = africastalking.initialize(username, api_key) sms = at.SMS response = sms.send('Hello', ['+254711000000']) print(response)
Debug
Known issues
breakingAfrica's Talking SDK v2.x changed initialization from `import africastalking` + `initialize()` returning a config object to the same pattern but with different service access via `at.SMS`. Code using v1.x patterns will fail.
fix
Update to: import africastalking; at = africastalking.initialize(username, api_key); sms = at.SMS
affects: >=2.0.0
deprecatedPassing API key as plaintext in code is deprecated and insecure. Use environment variables.
fix
Store API key in environment variable AT_API_KEY and use os.environ.get('AT_API_KEY', '')
affects: all
gotchaWhen using sandbox, username must be 'sandbox' and API key must be from sandbox dashboard. Production credentials will not work.
fix
Ensure you are using sandbox credentials for testing.
affects: all
Upgrade
Version history
2.0.2latest on PyPI · released Jan 8, 2026
Audit
Dependencies
requestsrequiredHTTP client for API calls
Agent activity
39 hits · last 30 days
node
30
OpenAI (training)
1
Resources
africastalking — pip install africastalking · libregistry