Skip to main content

Gabia SMS module for Django

Python 2 & 3 compatible

https://travis-ci.org/athenaslab/gabia-sms-Django.svg?branch=master https://coveralls.io/repos/github/athenaslab/gabia-sms-Django/badge.svg?branch=master

Installation

You can install the library directly from pypi using pip:

$ pip install gabia-sms-Django

Edit your settings.py file:

GABIA_SMS_SETTINGS = {
    'SENDER': 'YOUR NUMBER',
    'API_ID': 'YOUR API ID,
    'API_KEY': 'YOUR API KEY'
}

Dependencies

  • Python 2.7 or 3.4+

  • Django 1.11+

Quickstart

Send sms message to use shortcut function

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

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

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

import gabia_sms

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

Contributors

See https://github.com/hwshim0810/gabia-sms-Django/graphs/contributors

Metadata

Release files for gabia-sms-Django 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for gabia-sms-Django 1.2.1
File Interpreter ABI Platform
gabia_sms_Django-1.2.1-py3-none-any.whl Python 3 none any Details

Release files / gabia_sms_Django-1.2.1-py3-none-any.whl

Download URL gabia_sms_Django-1.2.1-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df8ff89226e97918977b4b840a0dde9466663196f1114ca0d6336b7b9208a110
BLAKE2b-256 checksum
How to use checksums
0fcc9f9247a159e936d7d02d2b5531e8874ceee01e45de64ce1525259faa51e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for gabia-sms-Django 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page