Skip to main content

Minimal OTP only API coverage for service

Project description

msg91-otp is one of the bulk SMS provider in India. This package msg91-otp is a python wrapper for sending and verifying OTPs using This is a minimal wrapper covers only OTP use-case and doesn't cover all HTTP API's exposed by msg91.


python install


from msg91_otp.client import OTPClient

# obtain this auth_key from
auth_key = "xxxxxxxxxxxxxxxxx"
otp_client = OTPClient(auth_key)

# 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)


  1. Prasanna Venkadesh


This package is licenced under GNU AGPL v3.0

Project details

Download files

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

Files for msg91-otp, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size msg91_otp-0.1.0-py3-none-any.whl (17.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size msg91-otp-0.1.0.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page