Skip to main content

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

  1. Create a free account at app.connectmedia.co.ke.
  2. Generate a 64-character API key under Profile, then API keys.
  3. 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 .

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)

Source distribution for connectmedia-sms 10.0.1
File Size Uploaded
connectmedia_sms-10.0.1.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for connectmedia-sms 10.0.1
File Interpreter ABI Platform
connectmedia_sms-10.0.1-py3-none-any.whl Python 3 none any Details

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 log

Release 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 log

Release history Release notifications | RSS feed

This release

10.0.1 This release

2 release files

10.0.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page