Skip to main content

A (limited) Python wrapper for Sveve's SMS sending API

Project description

sveve

A (limited) Python wrapper for Sveve's API

Based on API documentation.

I am in no way affiliated with Sveve and accept no liability for damages caused as a result of using this code.

Usage

The client attempts to convert any error messages returned by Sveve to HTTPExceptions from the requests library.

Initialising client

from sveve.client import SveveClient
client = SveveClient(user="usr", password="123", default_sender="funbit")

Sending an SMS

try:
  # Sending to one recipient using client's default_sender
  delivery_report = client.send_sms(to="12345678", msg="Hello world!")
except Exception:
  print("Something went wrong...")
else:
  print(delivery_report)

# Alternatively with multiple recipients
recipients = ["12345001", "12345002", "12345003"]
client.send_sms(to=recipients, msg="Hello world!")
# Or using a custom sender name
client.send_sms(to="12345678", msg="Hello world!", sender="Your Name")

Checking remaining balance

try:
  balance = client.remaining_sms()
except Exception:
  print("Something went wrong...")
else:
  print(f"You have {balance} messages remaining.")

# Alternatively with multiple recipients
recipients = ["12345001", "12345002", "12345003"]
client.send_sms(to=recipients, msg="Hello world!")
# Or using a custom sender name
client.send_sms(to="12345678", msg="Hello world!", sender="Your Name")

Project details


Release history Release notifications

Download files

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

Files for Sveve, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size Sveve-0.1.0-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size Sveve-0.1.0.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page