Skip to main content

Python client for the kwtSMS API (kwtsms.com)

Project description

kwtsms

Python client for the kwtSMS API — Kuwait SMS gateway.

Zero external dependencies. Python 3.8+.

Install

pip install kwtsms

Quick start

from kwtsms import KwtSMS

sms = KwtSMS.from_env()                              # reads .env or env vars
ok, balance, err = sms.verify()                      # test credentials
result = sms.send("96598765432", "Your OTP is: 123456")  # send SMS
result = sms.send("96598765432", "Hello", sender="MY-APP")  # override sender
report = sms.validate(["96598765432", "+96512345678"])   # validate numbers
balance = sms.balance()

Configuration

Create a .env file (or set environment variables):

KWTSMS_USERNAME=your_api_user
KWTSMS_PASSWORD=your_api_pass
KWTSMS_SENDER_ID=YOUR-SENDERID   # use KWT-SMS for testing only
KWTSMS_TEST_MODE=1                # 1 = test (safe default), 0 = live
KWTSMS_LOG_FILE=kwtsms.log

Or run the setup wizard:

kwtsms setup

CLI

kwtsms setup                                  # first-time wizard
kwtsms verify
kwtsms balance
kwtsms send 96598765432 "Your OTP is: 123456"
kwtsms validate 96598765432 +96512345678

Sender ID

KWT-SMS is a shared sender for testing only. Register a private sender ID on kwtsms.com before going live — use a Transactional sender ID for OTP messages to ensure delivery to DND numbers.

License

MIT

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

kwtsms-0.1.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

kwtsms-0.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kwtsms-0.1.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for kwtsms-0.1.0.tar.gz
Algorithm Hash digest
SHA256 064975974244bbc45ba3155dd526d4ac4654cad1f50176ea9e83cacc3a74ec5b
MD5 cb183fd19d40ca565ec3a27704ea7e4b
BLAKE2b-256 098b5ee587a9eb4e27eeb4dea263e72ff6f852c4ef66bc696735679a45d81469

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kwtsms-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for kwtsms-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 270dc52d8a177957e87c419863fa5bb7e2bff135ffc5026cfb749896f0dab8ae
MD5 b361ac4b6589bf36e6052f4f2b7d540c
BLAKE2b-256 9995b9f8e250da34c9c6813ce40f083236141eb6da89645939a9e224f76d7f75

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