Skip to main content

Python client library for the SMSFlow HTTPS API.

Project description

SMSFlow Python SDK

The SMSFlow Python SDK makes it easy to send SMS messages and check SMS credit balance from backend Python applications, automation scripts, scheduled jobs, CRM integrations, ERP integrations, and operational tooling.

Documentation: https://docs.smsflow.co.za/

Install

Package publishing is not enabled yet. During development, install locally:

pip install smsflow

Configuration

Store credentials in environment variables or your platform's secret manager.

export SMSFLOW_CLIENT_ID="YOUR_CLIENT_ID"
export SMSFLOW_CLIENT_SECRET="YOUR_CLIENT_SECRET"

Do not put SMSFlow Client Secrets in source code, logs, notebooks, screenshots, or public issues.

Usage

import os
from smsflow import SmsFlowClient

client = SmsFlowClient(
    client_id=os.environ["SMSFLOW_CLIENT_ID"],
    client_secret=os.environ["SMSFLOW_CLIENT_SECRET"],
)

response = client.send_sms(
    campaign_name="Python SDK example",
    messages=[
        {
            "destination": "27000000000",
            "content": "Your SMSFlow Python test message was sent successfully.",
        }
    ],
)

print(response["sendResponse"]["eventId"])

Features

  • Get and cache SMSFlow login tokens.
  • Send one or more SMS messages.
  • Schedule SMS messages using UTC delivery time.
  • Respect opt-out checks by default.
  • Check account balance.
  • Raise structured exceptions when the API returns an error.

Local test send

This command sends a real SMS and may consume test credits:

export SMSFLOW_CLIENT_ID="YOUR_CLIENT_ID"
export SMSFLOW_CLIENT_SECRET="YOUR_CLIENT_SECRET"
export SMSFLOW_DESTINATION="27000000000"
PYTHONPATH=src python examples/send_sms.py

Security

Never commit real credentials. Use environment variables or a secret manager.

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

smsflow-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

smsflow-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smsflow-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smsflow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ee99eba7af03247264489f4c03fd4927cbee3206add138b4ea335a748d2b9b3c
MD5 09d4451829f64543c6738516f233cc3e
BLAKE2b-256 5bbce98e9492e300887acb27122e88486a0af328a0f82d510bcef7631886b7a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for smsflow-0.1.0.tar.gz:

Publisher: publish.yml on SMSFlow-ZA/smsflow-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: smsflow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smsflow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b73569009cf6027ec656058db1f594eba779d19f57f06efb3feeb4ed781c4dd4
MD5 dc527a7a291e53c19d0c86c5b9605987
BLAKE2b-256 45c515a437fae70a8d1a0cf0105e9a9b02a7af916eed878715d0c7c29db66116

See more details on using hashes here.

Provenance

The following attestation bundles were made for smsflow-0.1.0-py3-none-any.whl:

Publisher: publish.yml on SMSFlow-ZA/smsflow-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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