Skip to main content

The simplest way to text people (send SMS) via python.

Project description

badge_pipeline badge_coverage badge_release badge_pyver badge_license

🚩 Table of contents

  1. 👀 What is bulksms?

  2. 📌 Requirements

  3. 🚀 Quick start

  4. 💙 Help us be better

  5. 🎖️ License

👀 What is bulksms?

bulksms is the simplest way to text people (send SMS) via python:

import bulksms

bsms = bulksms.BulkSMS(token_id='17A7C58921F54B5899D5C1237FCCD5FA-02-F', token_secret='9Sj8Ae9WQhBMEI2eMGXIKpZHC8shq')

bsms.send('+123456789', 'Hello world! 👋🏻')

bulksms uses BulkSMS.com to deliver SMS.

Features

This library allows you to:

  • Send SMS to one recipient

  • Bulk-send an SMS to many recipients at once

  • Look up the delivery cost of a previous message

  • Look up the delivery status of a previous message

  • Customize the delivery type to trade time with cost

  • Customize the sender ID e.g. to your mobile number or a company name

  • Send “long SMS” exceeding the single-message length, using SMS concatenation

  • Send messages with plain text (160 characters/message) or Unicode, e.g. emojis (67 characters/message)

📌 Requirements

  • Python version between 3.9 and 3.12

  • An account at BulkSMS.com with some delivery credits

  • If you want to use custom sender IDs (e.g. your company name or your own mobile number), you need to have them configured in your BulkSMS account.

  • You need internet connectivity and HTTPS open towards api.bulksms.com to reach the delivery API

🚀 Quick start

Install the bulksms library into it:

pip install bulksms

Write some code to deliver messages:

import bulksms

# authenticate to BulkSMS with token data (log into BulkSMS > Settings > Advanced > API Tokens)
bsms = bulksms.BulkSMS(token_id='17A7C58921F54B5899D5C1237FCCD5FA-02-F', token_secret='9Sj8Ae9WQhBMEI2eMGXIKpZHC8shq')
bsms.send('+123456789', 'Hello world! 👋🏻')

Done!

Here’s some more advanced use-cases to deliver SMS:

import bulksms

bsms = bulksms.BulkSMS(token_id='17A7C58921F54B5899D5C1237FCCD5FA-02-F', token_secret='9Sj8Ae9WQhBMEI2eMGXIKpZHC8shq')

# send a message with a custom mobile number as Sender
bsms.send('+123456789', 'Hello world! 👋🏻', sender='+1666777888')
# send a message with a custom brand as SenderID
bsms.send('+123456789', 'Hello world! 👋🏻', sender='Google inc')

# send a text to a bunch of receivers in bulk
bsms.send(['+123456789', '+4985296345', '+44785612458'], 'Hello world! 👋🏻')

# send a text message with top priority
bsms.send('+123456789', 'Hello world! 👋🏻', priority=True)

And here’s some inspection use-cases:

import bulksms

bsms = bulksms.BulkSMS(token_id='17A7C58921F54B5899D5C1237FCCD5FA-02-F', token_secret='9Sj8Ae9WQhBMEI2eMGXIKpZHC8shq')

# look up what's the current delivery status of a message
msgid = bsms.send('+123456789', 'Hello world! 👋🏻')

dstatus = bsms.msg_delivery_status(msgid)
# dstatus is in {'ACCEPTED', 'SCHEDULED', 'SENT', 'DELIVERED', 'FAILED'}

dcost = bsms.msg_cost(msgid)
# dcost is a float showing the number of credits consumed to deliver the message

💙 Help us be better

Here’s how you can help:

  • ⭐️ star our repository if you like bulksms.

  • Mention bulksms in any of your online posts so people find out about it.

And if you’re a developer:

  • Report any issue in our code or docs. We take those seriously.

  • Package bulksms for your distribution. Else Ubuntu, Debian, CentOS and FreeBSD will serve the most people.

🎖️ License

bulksms is open-source software (BSD 3-clause license).

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

bulksms-1.0.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

bulksms-1.0.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file bulksms-1.0.0.tar.gz.

File metadata

  • Download URL: bulksms-1.0.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for bulksms-1.0.0.tar.gz
Algorithm Hash digest
SHA256 02079f6a1198db99e9e8349c53301cde82f52bf12063bf7bafc0584fa27b4c56
MD5 0ec4c5abf2a01ab83ff3624d15f26076
BLAKE2b-256 8ea67c30f9ea41777cd6b7b3b54c3538b00a5dd84963adc72dcb7eb6073664de

See more details on using hashes here.

File details

Details for the file bulksms-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bulksms-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for bulksms-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f699bdfae10b7c7bc0d9552b52212e25273e135d7e63a66a94bfc514d0de0fc
MD5 14e9cef3af4ec058cbfb08fcaea7b801
BLAKE2b-256 9ab965d7d9274d3b0bcd51df605db7589571c6e51535c0a6bf86c342d5209b31

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