Connect Media SMS for Python
Official Python client for the Connect Media SMS API. Send bulk and transactional SMS to Safaricom, Airtel and Telkom numbers in Kenya and to 190+ countries, check your balance, read sent history with delivery status and receive customer replies.
Get an API key
- Create a free account at dashboard.connectmedia.co.ke.
- Generate a 64-character API key under Profile, then API keys.
- Top up any amount and register a sender ID (see sender ID registration in Kenya).
Install
pip install connectmedia-sms
Usage
from datetime import datetime
from connectmedia_sms import Client, ConnectMediaError
client = Client("YOUR_64_CHARACTER_API_KEY")
try:
client.send("0712345678", "Your order has shipped.", sender="YourBrand")
client.send(["0712345678", "0733000111"], "Fees are due on Friday.", sender="YourSchool",
schedule_at=datetime(2026, 12, 1, 9, 0))
print(client.balance())
print(client.history(limit=10))
print(client.inbox(limit=10))
except ConnectMediaError as e:
print(e.code, e.message)
Response codes
| Action | Success code |
|---|---|
| send | 201 |
| balance | 200 |
| history | 202 |
| inbox | 302 |
Any other code raises an error carrying the API's code and message (for example 100 invalid API key, 101 insufficient balance, 104 invalid recipients, 105 invalid message, 500 server error). Network failures use code network; a non-JSON reply uses invalid_response.
Numbers are normalised for you: 0712345678, +254 712 345 678 and 254712345678 all become 254712345678. International numbers are passed through without punctuation.
Tests
python -m unittest discover -s tests -t .
Links
- Website: connectmedia.co.ke
- API documentation: connectmedia.co.ke/developers
- Pricing (SMS from KES 1.0, no minimum top-up, credit never expires): connectmedia.co.ke/pricing
- Bulk SMS API for Kenya: connectmedia.co.ke/bulk-sms-api-kenya
- Support: info@connectmedia.co.ke · +254 707 339 945
License
MIT
Release files for connectmedia-sms 10.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| connectmedia_sms-10.0.0.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| connectmedia_sms-10.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / connectmedia_sms-10.0.0.tar.gz
| Download URL | connectmedia_sms-10.0.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47a0235d8b899a610de90f1c7e75ed739396efc803e7c2df1a9eece3bbc197df
|
|
BLAKE2b-256 checksum How to use checksums |
1f574069a77ed9a6cf4ca7adc692fe1de3848eb539c5ff31a956103c7156f944
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / connectmedia_sms-10.0.0-py3-none-any.whl
| Download URL | connectmedia_sms-10.0.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
383b73e679db13bf1c41ba0429703984a08af675a18ca25fd0fa79b209579af3
|
|
BLAKE2b-256 checksum How to use checksums |
2cc8aa9194390d8cdef0a68a2bdf7a9b8c602aa9b92c5ddb9a383beba543e451
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency log