Coder Social home page Coder Social logo

comilio / python-sms-send Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5 KB

Python client library to send SMS using Comilio SMS Gateway

License: MIT License

Python 100.00%
sms sms-api sms-client python sms-sdk python-library pypi-packages sms-messages

python-sms-send's Introduction

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 [email protected]

Installation

$ pip install comilio

Send a message

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:

comilio_client.send(text, type=comilio.SMART)

Or, you can change it globally:

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

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:

{"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:

comilio_client.raise_insufficient_credit = True

More info

You can check out our website https://www.comilio.it

python-sms-send's People

Contributors

franco-dalfovo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.