Skip to main content

A Python SDK for the FastOTP service

Project description

FastOtp

The FastOTP Wrapper SDK is designed to simplify the integration and usage of the FastOTP service in Python applications. FastOTP is a service that provides functionality for generating, validating, and delivering One-Time Passwords (OTPs) through various channels.

Installation

To install PyResponse, you can use pip:

pip install fastotp

Usage

Fastotp can be used with different web frameworks, including Django, FastAPI, and Flask. Here's how you can use Fastotp in each framework:

# Example usage

from fastotp_sdk.client import FastOTPClient, TokenType

Initialize FastOTP client

api_key = "your_api_key"
fastotp_sdk = FastOTPClient(api_key)

Generate OTP

generated_otp = fastotp_sdk.generate_otp(token_type=TokenType.NUMERIC, token_length=6, validity=10)
print("Generated OTP:", generated_otp)

Validate OTP

validation_result = fastotp_sdk.validate_otp(identifier="example_identifier", token="123456")
print("Validation Result:", validation_result)

Get OTP Details

otp_details = fastotp_sdk.get_otp_details(otp_id="123")
print("OTP Details:", otp_details)

Django

  1. Install FastOtp using pip as shown in the installation section.
  2. Import the necessary functions from FastOtp in your Django views or API handlers.
# In your views or models
from fastotp_sdk.client import FastOTPClient, TokenType

api_key = "your_api_key"
fastotp_sdk = FastOTPClient(api_key)

# Generate OTP
generated_otp = fastotp_sdk.generate_otp(token_type=TokenType.NUMERIC, token_length=6, validity=10)

# Use generated_otp as needed in your Django application

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Project details


Download files

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

Source Distribution

fastotp-sdk-1.0.0.tar.gz (2.7 kB view hashes)

Uploaded Source

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