Metadata-Version: 2.4
Name: otp-toolkit
Version: 0.1.1
Summary: Simple OTP generation and verification toolkit
Home-page: 
Author: Yawar Hussain
Author-email: hussainyawar140504@gmail.com
License: MIT
Keywords: otp security authentication python
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/plain
License-File: LICENCE.txt
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: summary

# otp-toolkit

A lightweight Python utility for generating and verifying OTPs (One-Time Passwords).

## Features
- Secure OTP generation
- Expiry handling
- SHA256 hashing
- Framework independent (works with Django, Flask, FastAPI)

## Installation
```bash
pip install otp-toolkit

## Example

from otp_toolkit import generate_otp, hash_otp, verify_otp

# Step 1: Generate OTP
otp, expires_at = generate_otp(length=6, expires_in=300)
hashed_otp = hash_otp(otp)

# Send `otp` to user via email/SMS (not shown here)

# Step 2: Verify OTP entered by user
user_input = "123456"

if verify_otp(user_input, hashed_otp, expires_at):
    print("Login successful")
else:
    print("Invalid or expired OTP")


Change Log
=============

0.1.1 (02/02/2026)
------------------
- Improved README with detailed usage examples
- Added real-world OTP flow examples

0.1.0 (02/02/2026)
------------------
- First release
- Secure OTP generation
- OTP expiry handling
- OTP hashing and verification
