Minimal OTP only API coverage for msg91.com service
Project description
msg91-otp
msg91.com is one of the bulk SMS provider in India. This package msg91-otp is a python wrapper for sending and verifying OTPs using msg91.com. This is a minimal wrapper covers only OTP use-case and doesn't cover all HTTP API's exposed by msg91.
Install
python setup.py install
Usage
from msg91_otp.client import OTPClient
# obtain this auth_key from msg91.com
auth_key = "xxxxxxxxxxxxxxxxx"
otp_client = OTPClient(auth_key)
sender = "YOUR_SERVICE_NAME"
# if OTP value is not supplied, msg91 automatically creates for you
message = "Your One Time Password (OTP) is"
receiver = "9876543210"
service_response = otp_client.send_otp(receiver, sender=sender, message=message)
# if you want to supply your own OTP
otp = 3342
service_response = otp_client.send_otp(receiver, otp=otp)
print (service_response.status, service_response.message)
# verify OTP for a given mobile number
verify_response = otp_client.verify_otp(receiver, otp)
print (verify_response.status, verify_response.message)
# re-send a OTP
otp_resend = otp_client.resend_otp(receiver)
print (otp_resend.status, otp_resend.message)
# Asynchronous client follows the same method signatures
from msg91_otp.client import AsyncOTPClient
async_client = AsyncOTPClient(auth_key)
await async_client.send_otp(receiver)
Contributors
- Prasanna Venkadesh
License
This package is licenced under GNU AGPL v3.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file msg91-otp-0.1.0.tar.gz.
File metadata
- Download URL: msg91-otp-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a2f08ee021612d883c8772a83fbbfb12c39b797515e55f888935cb5f0d04b72
|
|
| MD5 |
680c6f1ea102e49d082f53e99b0b5dde
|
|
| BLAKE2b-256 |
ef5d6650800863c9d77ef76dc58a707c0826a7181b20f0f7026fc71dd705b007
|
File details
Details for the file msg91_otp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: msg91_otp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ababdea82155c9d692ff855c0c908c9cb90d4316a9d354880c725054f45ff62b
|
|
| MD5 |
3af20ff9cd7f13daa7510f770ae8f7ed
|
|
| BLAKE2b-256 |
15f9d6abc3f2b10cd99d6ca51049459b395c342bfc22f924836a98b33f5da8b9
|