https://github.com/comilio/python-sms-send
Python client library to send SMS using Comilio SMS Gateway
https://github.com/comilio/python-sms-send
pypi-packages python python-library sms sms-api sms-client sms-messages sms-sdk
Last synced: 5 months ago
JSON representation
Python client library to send SMS using Comilio SMS Gateway
- Host: GitHub
- URL: https://github.com/comilio/python-sms-send
- Owner: comilio
- License: mit
- Created: 2017-12-22T14:16:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-27T11:09:56.000Z (almost 8 years ago)
- Last Synced: 2025-09-12T07:57:56.206Z (9 months ago)
- Topics: pypi-packages, python, python-library, sms, sms-api, sms-client, sms-messages, sms-sdk
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Comilio Python SMS Send
Python client module to send SMS messages using Comilio SMS Gateway.
To use this library, you must have a valid account on https://www.comilio.it.
**Please note** SMS messages sent with this library will be deducted by your Comilio account credits.
For any questions, please contact us at tech@comilio.it
# Installation
```bash
$ pip install comilio
```
# Send a message
```py
import comilio
comilio_client = comilio.Client('username', 'password')
comilio_client.send('Hello!', '+393401234567')
# returns:
{"message_id": "string"}
```
By default, client sends Classic type messages. You can change that per message:
```py
comilio_client.send(text, type=comilio.SMART)
```
Or, you can change it globally:
```py
comilio_client.set_default_type(comilio.SMART)
```
Available options are `comilio.CLASSIC`, `comilio.SMART` and `comilio.SMARTPRO`.
# Setting default options
You might want to send bulk messages. We're making it slightly easier for you!
`comilio_client.set_default_sender` and `comilio_client.set_default_recipients` are also available. Check examples for more informations.
# Check status of message
```py
comilio_client.status('A95455F7031140769030CCA81E764C5F')
# returns:
[
{"phone_number": "+393401234567", "status": "Sent"}
]
```
# Handling insufficient credit
If you have insufficient credit, by default, you'll get a response like this one:
```json
{"error": "Insufficient+credit"}
```
If you'd prefer to have an exception thrown in such case, set `raise_insufficient_credit` attribute to `True` on the initialized Client object:
```py
comilio_client.raise_insufficient_credit = True
```
# More info
You can check out our website https://www.comilio.it