Skip to main content

kalourmade-sailup

Python SDK for the Sailup SMS gateway.

Install

pip install kalourmade-sailup

Requires Python 3.9+. Single dependency: httpx.

Quickstart

import os
from kalourmade_sailup import SailupClient

client = SailupClient(os.environ["SAILUP_API_KEY"])

message = client.sms.send(
    from_="MyBrand",
    to=["233241234567"],
    body="Hello from Sailup",
)

Error handling

from kalourmade_sailup.exceptions import (
    AuthenticationError, ValidationError, RateLimitError, ApiError, NetworkError,
)

try:
    client.sms.send(from_="MyBrand", to=["233241234567"], body="Hi")
except AuthenticationError:
    ...  # invalid/missing API key
except ValidationError:
    ...  # bad request payload
except RateLimitError:
    ...  # back off and retry
except ApiError as e:
    ...  # other API error — e.status_code, e.raw_body
except NetworkError:
    ...  # couldn't reach Sailup

Verifying webhooks

from kalourmade_sailup import Webhooks
from kalourmade_sailup.exceptions import InvalidSignatureError

try:
    event = Webhooks.verify(raw_body, request.headers, os.environ["SAILUP_WEBHOOK_SECRET"])
except InvalidSignatureError:
    return Response(status=400)

Full documentation, runnable examples, and the PHP/Node SDKs: github.com/kalourmade/sailup-sdk.

Download files

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

Source Distribution

kalourmade_sailup-0.1.3.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

kalourmade_sailup-0.1.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file kalourmade_sailup-0.1.3.tar.gz.

File metadata

  • Download URL: kalourmade_sailup-0.1.3.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for kalourmade_sailup-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f256874bf94ea57e2997b485ad1009c055f975efc0394d08df92de82f096d002
MD5 e2523cd5f830bd82b721baf7b2ed764b
BLAKE2b-256 e47144cee8a656e9cc6ce6bb3c90c4de13aba1ddaf8e23ebb000ca469a7cb8e0

See more details on using hashes here.

File details

Details for the file kalourmade_sailup-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for kalourmade_sailup-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0ae9dd9ec79f79ebcd02a296c8398f84cec000cf3061affe6593a7e75a5d48d7
MD5 8d195d1ee65d333f6d3db1bf421d1d60
BLAKE2b-256 bac46350e683446a9b9784edb9ed5e99dff2c3eebb5ff165c480847470ed1b33

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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