Skip to main content

DikshantLock

PyPI Python License Downloads

A secure password generation toolkit for Python applications with guaranteed character inclusion.

Table of Contents

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:

  • ValueError if 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

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. 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

Metadata

Release files for dikshantlock 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dikshantlock 1.0.0
File Size Uploaded Provenance
dikshantlock-1.0.0.tar.gz 4.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dikshantlock 1.0.0
File Interpreter ABI Platform
dikshantlock-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / dikshantlock-1.0.0.tar.gz

Download URL dikshantlock-1.0.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
94169b69ff4cd60c719809aaf7912b505fde67e59b95999b95c09fb3789dbe98
BLAKE2b-256 checksum
How to use checksums
cb3676016104fbfbc7ff215cd89febc6c4a90d98d8d09ae40a0e011152050b4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / dikshantlock-1.0.0-py3-none-any.whl

Download URL dikshantlock-1.0.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd9462e15e2c179b38dfe60fa9c67de7d765a16e566b8b86d5c99aa8a7e058d4
BLAKE2b-256 checksum
How to use checksums
ff40a09e33e15cf47ff7f6f10ddf1d9c5db7faa2edd39f4abea135d7a0bcc92c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for dikshantlock 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page