allsafe-otp
Project Overview
allsafe-otp is a simple Python package for generating Time-Based One-Time Passwords (TOTP) and QR codes for two-factor authentication (2FA). It allows you to easily create secure OTPs and generate QR codes that can be scanned with Google Authenticator or other 2FA apps.
Features
- Generate secure TOTP codes using the HMAC-SHA1 algorithm.
- Create scannable QR codes for Google Authenticator or any 2FA app.
- Easy to integrate into your Python projects.
Installation
pip install allsafe-otp
Usage
1. Generate a TOTP Code
from allsafe_otp.totp import generate_otp
secret = "JBSWY3DPEHPK3PXP" # Your base32 secret
otp = generate_otp(secret)
print(f"Generated OTP: {otp}")
2. Generate a QR Code for Google Authenticator
from allsafe_otp.generate_qr import generate_qr_code
otp_url = "otpauth://totp/MyApp:daniel@allsafe.com?secret=JBSWY3DPEHPK3PXP&issuer=MyApp"
generate_qr_code(otp_url)
Testing
To test the package:
- Install the package (if not already installed):
pip install allsafe-otp
- Create a test script (
test.py):
from allsafe_otp.totp import generate_otp
from allsafe_otp.generate_qr import generate_qr_code
secret = "JBSWY3DPEHPK3PXP"
print("Generated OTP from Python:", generate_otp(secret))
otp_url = "otpauth://totp/MyApp:daniel@allsafe.com?secret=JBSWY3DPEHPK3PXP&issuer=MyApp"
generate_qr_code(otp_url)
Project Structure
allsafe-otp/
├── allsafe_otp/
│ ├── __init__.py
│ ├── generate_qr.py
│ └── totp.py
├── setup.py
└── README.md
Contributing
Feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for allsafe-otp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| allsafe_otp-0.1.1.tar.gz | 3.1 kB | Without provenance | Details for allsafe_otp-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| allsafe_otp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for allsafe_otp-0.1.1-py3-none-any.whl |
Total release size: 6.8 kB
Release files / allsafe_otp-0.1.1.tar.gz
| Download URL | allsafe_otp-0.1.1.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2977ac158a0b7c368e63d1c183b60c861719fd0baa6b4de3d9871e02c87ad3a0
|
|
BLAKE2b-256 checksum How to use checksums |
b3f3d7e25125df854d7a09f4c5d5d8c5123f4cdb9247ccfc0b206e3f86d533ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / allsafe_otp-0.1.1-py3-none-any.whl
| Download URL | allsafe_otp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4218e86c79278fd27377835c62d825f2204e0c0f2b1b5aabd490986a67a4de9
|
|
BLAKE2b-256 checksum How to use checksums |
95cd8f5db6e3615ba7e710f6a3e992819f4da851fa29aaa6dd2baacfaa469b6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for allsafe-otp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.