Skip to main content

Send SMS messages to mobile devices through GABIA SMS api.

Project description

===========================
Gabia SMS module for Python
===========================

Python 2 & 3 compatible

- Source code: `<https://github.com/taylor-kang/gabia-sms-python>`_
- Distribution: `<https://pypi.org/project/gabia-sms-python>`_
- Maintainer: `<https://github.com/taylor-kang>`_

Installation
------------

You can install the library directly from pypi using pip:

.. code-block:: shell

$ pip install gabia-sms-python

Dependencies
------------

- Python 2.7 or 3.4+

Quickstart
----------

Send sms message to use shortcut function

.. code-block:: python

import gabia_sms

try:
# Send single SMS
gabia_sms.send(message='message', receiver='will receive phone number')

except SMSModuleException:
print('SMS send failure')

- SMS Types: ['sms', 'lms', 'multi_sms', 'multi_lms']
- Send function returning Tuple(Unique key, Result code)

More usage
----------

.. code-block:: python

import gabia_sms

try:
# Reserve single SMS
gabia_sms.send(
message='message',
receiver='will receive phone number',
scheduled_time='2018-02-02 22:22:22'
)

# if not assign scheduled_time, send immediately
gabia_sms.send(
message='message',
receiver='will receive phone number'
)

# Send multiple SMS
gabia_sms.send(message='message', receiver=['phone number', '...'])
gabia_sms.send(message='message', receiver=('phone number', '...'))

# Reserve multiple SMS
gabia_sms.send(
message='message',
receiver=['phone number', '...'],
scheduled_time='2018-02-02 22:22:22'
)

# Cancel reservation
gabia_sms.cancel_reservation('Unique key', 'SMS type')

# Request result code
gabia_sms.get_send_result('Unique key')

except SMSModuleException:
print('SMS send failure')


Advanced usage
--------------
Inherit SMS class, override post_sent_sms / before_send_sms

.. code-block:: python

import gabia_sms

class AdvancedSMSModule(gabia_sms.GabiaSMS):

def post_sms_sent(self, param, *args, **kwargs):
# ... Do what you need

def before_send_sms(self, param, *args, **kwargs):
# ... Do what you need

AdvancedSMSModule.send(message='message', receiver='will receive phone number')

or Use SingletonClass

.. code-block:: python

import gabia_sms

class AdvancedSMSModule(gabia_sms.SingletonGabiaSMS):
# ...
pass

Acknowledgements
--------------
Thanks `https://github.com/athenaslab/gabia-sms-Django` for gabia-sms-Django version

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

gabia_sms_python-1.0.1-py2-none-any.whl (7.1 kB view details)

Uploaded Python 2

File details

Details for the file gabia_sms_python-1.0.1-py2-none-any.whl.

File metadata

  • Download URL: gabia_sms_python-1.0.1-py2-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for gabia_sms_python-1.0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 9255b7526571c824d1906c4502a314b606f1ef95382bfe5fc168e35cfa73ab6c
MD5 102e26d7352d7ab7a1fc69184b88d52b
BLAKE2b-256 54fbe09ad3898c642e7d3756117a687685a7d4e6fe32313f83c0415daf1b0cd6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page