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 app.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
Metadata
Release files for connectmedia-sms 10.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| connectmedia_sms-10.0.1.tar.gz | 6.2 kB | With provenance | Details for connectmedia_sms-10.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| connectmedia_sms-10.0.1-py3-none-any.whl | Python 3 | none | any | Details for connectmedia_sms-10.0.1-py3-none-any.whl |
Total release size: 12.1 kB
Release files / connectmedia_sms-10.0.1.tar.gz
| Download URL | connectmedia_sms-10.0.1.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e51c2685733aa75cf9cb8b2cb2889c4b92f509d625415334a868ae9c12378fa6
|
|
BLAKE2b-256 checksum How to use checksums |
06ffc1c44c422dd92b2482a516a2f52e9057898af94c610640a072f366353a9b
|
| 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 Oct 1, 2026.
Transparency logRelease files / connectmedia_sms-10.0.1-py3-none-any.whl
| Download URL | connectmedia_sms-10.0.1-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93c9e68a376693b18651cf535c8f050cf11e44633d6210d31b992b40829a85ea
|
|
BLAKE2b-256 checksum How to use checksums |
f678e6c83ad4187bf04ffc56e938d07bb06af8fecd46cb5dfd07effa9f9b3d9a
|
| 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 Oct 1, 2026.
Transparency logSecurity for connectmedia-sms 10.0.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for connectmedia_sms-10.0.1.tar.gz
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 Oct 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.