All Projects → beem-africa → python-client

beem-africa / python-client

Licence: MIT license
A Python library to ease the integration with the Beem Africa (SMS, AIRTIME, OTP, 2WAY-SMS, BPAY, USSD)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-client

pyswahili
A Swahili version of programming language to allow Swahili speakers get started with programming
Stars: ✭ 64 (+166.67%)
Mutual labels:  tanzania, python-tanzania
Nida
Unofficial package for fetching users information based on National ID Number (Tanzania)
Stars: ✭ 47 (+95.83%)
Mutual labels:  tanzania, python-tanzania
mtaa
A package consisting of all Tanzania locations from region to streets in an easily accessible way
Stars: ✭ 27 (+12.5%)
Mutual labels:  tanzania, python-tanzania
matrix-pstn-bridge
☎️ A Matrix Puppet bridge for the public telephone network that supports a number of VoIP providers (Twillo, Vonage, etc.). Sends and receives voice and SMS.
Stars: ✭ 25 (+4.17%)
Mutual labels:  sms-gateway
e-voting-with-django
The Voting System web application using Django is a project that serves as the automated voting system of an organization or school. This system works like the common manual system of election voting system whereas this system must be populated by the list of the positions, candidates, and voters. This system can help a certain organization or s…
Stars: ✭ 54 (+125%)
Mutual labels:  sms-gateway
pesa-js
Pesa SDK
Stars: ✭ 19 (-20.83%)
Mutual labels:  tanzania
Plagiarism-checker-Python
A python project for checking plagiarism of documents based on cosine similarity
Stars: ✭ 114 (+375%)
Mutual labels:  tanzania
cht-gateway
Android SMS gateway app for CHT Applications
Stars: ✭ 60 (+150%)
Mutual labels:  sms-gateway
php-pesa
Open payment integration toolkit for PHP
Stars: ✭ 26 (+8.33%)
Mutual labels:  tanzania
Easy Sms
📲 一款满足你的多种发送需求的短信发送组件
Stars: ✭ 2,646 (+10925%)
Mutual labels:  sms-gateway
CodeForAfrica.org
The @CodeForAfrica landing page. Built with Jekyll and hosted on Github Pages. Accessible at https://codeforafrica.org/
Stars: ✭ 20 (-16.67%)
Mutual labels:  tanzania
Listmonk
High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
Stars: ✭ 7,294 (+30291.67%)
Mutual labels:  sms-gateway
messages-web
📱 SMS gateway using your own phone!
Stars: ✭ 34 (+41.67%)
Mutual labels:  sms-gateway
laravelbdsms
Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways like sslcommerz, greenweb, dianahost, metronet,boomcast, bulksmsbd, banglalink from Laravel framework
Stars: ✭ 68 (+183.33%)
Mutual labels:  sms-gateway
tz-mpesa-ussd-push
Vodacom Tanzania USSD Push API Client
Stars: ✭ 18 (-25%)
Mutual labels:  tanzania
tp-link-modem-router
Goodies for TP-Link modem routers
Stars: ✭ 44 (+83.33%)
Mutual labels:  sms-gateway
pindo-cli
A simple Command Line Interface that allows you to authenticate with the Pindo API.
Stars: ✭ 32 (+33.33%)
Mutual labels:  sms-gateway
Kalkun
Open Source Web based SMS Manager
Stars: ✭ 186 (+675%)
Mutual labels:  sms-gateway
sms
Simple SMS Gateway Package for sending short text messages from your Application. Facade for Laravel 5(Updated to work with Laravel 5.5).Currently supported Gateways Clickatell, MVaayoo, Gupshup, SmsAchariya, SmsCountry, SmsLane, Nexmo, Mocker / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.
Stars: ✭ 41 (+70.83%)
Mutual labels:  sms-gateway
tra-docs
TRA Documentation
Stars: ✭ 15 (-37.5%)
Mutual labels:  tanzania

python-client

A Python library to easy the integration with the Beem Africa SMS Gateway

Downloads Downloads Downloads

Features to be Implemented

  • Airtime
  • OTP
  • SMS
  • Two way SMS
  • USSD
  • Bpay

Getting started

To get started with exploring beem-africa you can either clone the repository or install directly from pip (pre-release is already deployed)

Installing from pip

pip install beem-africa

Installing directly from github

git clone https://github.com/beem-africa/python-client
cd python-client
python setup.py install

Authentication

The first thing you need to do before calling module in the beem-africa app is authorize our app with access key and secret key which can be obtained as you signup for beem-official website.

Do this to Authenticate !!

>>> from BeemAfrica import Authorize, AirTime, OTP, SMS
>>> Authorize('access-key', 'secret-key')

Sending SMS with BeemAfrica

To send SMS with beem africa now made easy, you can use single method to send single and multiple messages at once.

Here how you would send a single SMS with beem-africa, Note that I'm assuming you have already entered the correct access-key and secret-key

>>> SMS.send_sms('hello pythonista', '255xxxxxxxxxx')
{'successful': True, 'request_id': 35918915, 'code': 100, 'message': 'Message Submitted Successfully', 'valid': 1, 'invalid': 0, 'duplicates': 0}

The above example is that I'm assuming you're using default BeemAfrica sender ID to use yours just do this instead;

>>> SMS.send_sms(
        'You\'re now verified',
        '255xxxxxxxxx', 
        sender_id='new-sender-id'
        )

{'successful': True, 'request_id': 35918915, 'code': 100, 'message': 'Message Submitted Successfully', 'valid': 1, 'invalid': 0, 'duplicates': 0}

You can also schedule message to be sent after a certain time or at a specific time to do that together with new sender_id, do this instead !!

>>> SMS.send_sms(
        'You have won a 10 Million', 
        '2557xxxxxxxxx', 
        sender_id='new-sender-d', 
        schedule_time='scheduled time'
    )
{'successful': True, 'request_id': 35918915, 'code': 100, 'message': 'Message Submitted Successfully', 'valid': 1, 'invalid': 0, 'duplicates': 0}

Also instead of sending to one recipient per time you can send an SMS to Multiple clients at Once you just have to twist the send_sms() to look like this;

>>> SMS.send_sms('my-message', ['2557xxxxxx', '2557xxxxxx'])

Verifying One Time password with BeemAfrica

Apart from just sending SMS, Beem also provides OTP Services for One Time password verification system that is expected to be expired after a certain time that has been specified.

You can also use OTP to do 2-factor-authentication system to your app/website, Beem will generate a random OTP for you and provide you an endpoint to verify it.

Here how to send OTP with Beem !!

>>> OTP.send_otp('2557xxxxxx')
{'data': {'pinId': '4a5c2141-c965-4a9d-aca4-54f58063e831', 'message': {'code': 100, 'message': 'SMS sent successfully'}}}

To verify the OTP send to user do this !!

Note: Use pin_id from response you just recieve while sending an OTP and the PIN sent to user phone to verify the OTP, its going to look like this !!

>>> OTP.verify(pin_id='4a5c2141-c965-4a9d-aca4-54f58063e831', pin='122496')
{'data': {'message': {'code': 117, 'message': 'Valid Pin'}}}

AirTime

BeemAfrica also provide interface to interact with AirTime allowing you to easily transfer AirTime from BeemAfrica Credit to customer mobile !!

Here how to Transfer AirTime to customer mobile with Beem Africa !!

>>> AirTime.transfer_airtime('255757294146', 100)
{'code': 200, 'transaction_id': 1619484193194, 'message': 'Disbursement is in progress'}

By doing that now after few seconds check AirTime balance on mobile and it going to increase by +100 .

You can also check balance of remaining credit balance by doing this

>>> AirTime.get_credit_balance()
{'data': {'credit_bal': '708.0357'}}

Well these are the only implemented features by now !

Issues

Are you facing any issue with the integration of beem-africa libray, please raise an Issue so as we can fix as soon as we can !!

Contribution ?

Would you like to contribute to beem-africa python-client, Contributions of any kind is really welcomed, just fork it .. you can also reach me direct if you face any issue with contributing at isaaackeinstein(at)gmail(dot)com.

Give it star ?

Was this repository useful to you in any means, well then give it a star so as more people can get to know it.

Credits

All the credits to kalebu and all the future contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].