Secure password generation toolkit
Project description
DikshantLock
A secure password generation toolkit for Python applications with guaranteed character inclusion.
Table of Contents
- Features
- Installation
- Basic Usage
- Advanced Usage
- API Reference
- Examples
- Security Guarantees
- Contributing
- License
Features
- Generate cryptographically strong passwords
- Customizable length (8-64 characters)
- Toggle character sets:
- Lowercase letters (a-z)
- Uppercase letters (A-Z)
- Digits (0-9)
- Special characters (!@#$%^&*)
- Guaranteed to include at least one character from each enabled set
- Properly shuffled to avoid predictable patterns
Installation
pip install dikshantlock
Basic Usage
from dikshantlock import generate
# Generate a default 12-character password
password = generate()
print(password) # Example: "k7@j9Lp2#qR!" (contains at least one of each character type)
# Generate a 16-character password without special chars
simple_pass = generate(length=16, special=False)
Advanced Usage
Custom Character Sets
# Numbers only (6-digit PIN code)
pin = generate(length=6, lowercase=False, uppercase=False, special=False)
# Letters only (no numbers/special chars)
memorable = generate(length=20, digits=False, special=False)
# No lowercase letters
password = generate(lowercase=False)
Maximum Security Password
max_security = generate(length=32) # 32 chars with all character sets enabled
API Reference
generate(
length=12,
lowercase=True,
uppercase=True,
digits=True,
special=True
)
Parameters:
length: Password length (8-64, default: 12)lowercase: Include a-z (default: True)uppercase: Include A-Z (default: True)digits: Include 0-9 (default: True)special: Include special chars (default: True)
Returns:
str- Generated password containing at least one character from each enabled set
Raises:
ValueErrorif length is invalid or no character sets are enabled
Examples
Generate API Key
api_key = generate(length=32, special=False) # Alphanumeric only
Create Database Password
db_pass = generate(length=24, lowercase=False) # Uppercase + digits + special chars only
Temporary Access Token
token = generate(length=16, special=False, uppercase=False) # Lowercase + digits only
Security Guarantees
- Uses cryptographically secure random number generation
- Always includes at least one character from each enabled character set
- Passwords are properly shuffled to avoid predictable patterns
- Validates all inputs to prevent weak password generation
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.
📫 Contact: Dikshant Ghimire - dikkughimire@gmail.com
🔗 Project Link: https://github.com/dikshantgh/dikshantlock
🐛 Report Issues: https://github.com/dikshantgh/dikshantlock/issues
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 dikshantlock-1.0.0.tar.gz.
File metadata
- Download URL: dikshantlock-1.0.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94169b69ff4cd60c719809aaf7912b505fde67e59b95999b95c09fb3789dbe98
|
|
| MD5 |
5817ae8a56045faede544a42e69786e7
|
|
| BLAKE2b-256 |
cb3676016104fbfbc7ff215cd89febc6c4a90d98d8d09ae40a0e011152050b4d
|
File details
Details for the file dikshantlock-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dikshantlock-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd9462e15e2c179b38dfe60fa9c67de7d765a16e566b8b86d5c99aa8a7e058d4
|
|
| MD5 |
cfd01a74b286381432f99c323fdb86f8
|
|
| BLAKE2b-256 |
ff40a09e33e15cf47ff7f6f10ddf1d9c5db7faa2edd39f4abea135d7a0bcc92c
|