Skip to main content

Python SDK for KenoSMS API

Project description

Hapa chini ni README.md (English version) ya package yako ya kenosms Python SDK. Unaweza kuiweka moja kwa moja kwenye repository yako kama README.md.


KenoSMS Python SDK

Official Python SDK for sending and managing SMS via the KenoSMS HTTP API.

This SDK allows you to:

  • Send SMS messages
  • Schedule SMS for later delivery
  • Retrieve a single SMS by UID
  • List all sent SMS messages

Installation

Install the package using pip:

pip install kenosms

Requirements

  • Python 3.8+
  • requests (installed automatically as a dependency)

Getting Started

1. Import the Class

from kenosms import KenoSMS

2. Initialize the Client

sms = KenoSMS(api_token="YOUR_API_TOKEN")

Replace YOUR_API_TOKEN with your actual API token provided by KenoSMS.


Send SMS

response = sms.send_sms(
    recipient="2557XXXXXXXX",
    sender_id="KENOSMS",
    message="Hello from KenoSMS Python SDK!"
)

print(response)

Parameters

Parameter Type Required Description
recipient string Yes Recipient phone number (e.g., 2557XXXXXXXX)
sender_id string Yes Registered Sender ID
message string Yes SMS message content
type string No SMS type (default: plain)
schedule_time string No Schedule date/time (format: YYYY-MM-DD HH:MM:SS)
dlt_template_id string No DLT Template ID if required

Send Scheduled SMS

response = sms.send_sms(
    recipient="2557XXXXXXXX",
    sender_id="KENOSMS",
    message="This message is scheduled",
    schedule_time="2026-02-25 10:00:00"
)

print(response)

Get a Single SMS

Retrieve SMS details using its unique ID (UID):

response = sms.get_sms(uid="SMS_UNIQUE_ID")

print(response)

List All SMS

response = sms.list_sms()

print(response)

API Endpoint

This SDK uses the following API endpoint:

https://sms.kenosis.co.tz/api/http/sms

Full Example

from kenosms import KenoSMS

sms = KenoSMS(api_token="YOUR_API_TOKEN")

response = sms.send_sms(
    recipient="2557XXXXXXXX",
    sender_id="KENOSMS",
    message="Test message from Python SDK"
)

print(response)

Error Handling Example

try:
    response = sms.send_sms(
        recipient="2557XXXXXXXX",
        sender_id="KENOSMS",
        message="Testing error handling"
    )
    print(response)
except Exception as e:
    print("Error:", str(e))

License

MIT License


Author

Fortunatus Chrispin Rwekiti KenoSMS Website: https://sms.kenosis.co.tz


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kenosms-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kenosms-0.1.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file kenosms-0.1.0.tar.gz.

File metadata

  • Download URL: kenosms-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for kenosms-0.1.0.tar.gz
Algorithm Hash digest
SHA256 caf479862b66a38583c72e0fad0ef069775346027e532d82b56a0c747cfed02c
MD5 85cc14fa60d770a1420eecbe38b3e443
BLAKE2b-256 d464d3cd56aee3b321a3f9f523bf9557182764d41ef8be3c0174ffc83e8d014d

See more details on using hashes here.

File details

Details for the file kenosms-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kenosms-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for kenosms-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5f61ad935b362a6b5972384053711f8480649f3877cdc2226a9d49b7e5b2db3
MD5 73585a8d68fd1415fa5395bda9724843
BLAKE2b-256 3b1386d055674a1836ab0b879fd669290fad596b4dcb398ce951c8a1befa49af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page