A command-line password generator with customizable complexity levels
Project description
genpass
A simple Python CLI tool for generating secure passwords with customizable length and complexity.
Features
- Supports three complexity levels:
- SIMPLE: Lowercase letters only
- MEDIUM: Mixed uppercase and lowercase letters
- HIGH: Mixed letters, digits, and special characters
- Input validation for length (integer between 1 and 100) and complexity
- Colored CLI output for success and error messages using
click - Modular design with strategies, validators, and distribution calculator
Installation
-
Clone the repository:
git clone https://github.com/yourusername/genpass.git cd genpass
-
(Optional) Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
(Optional) Install as an editable package:
pip install -e .
Usage
- Run the CLI with default options (entry point is
cli.py):
python -m generatepwd.cli
Or use the generatepwd entry point (if installed):
generatepwd -l 16 -c HIGH
Options:
-l,--length: Password length (default: 12)-c,--complexity: Complexity level (SIMPLE,MEDIUM,HIGH, default:SIMPLE)
Example:
generatepwd -l 20 -c medium
# Output: Generated Password: fRLsSiPlnYaNtgpMfPQY
Project Structure
pyproject.toml
requirements.txt
README.md
src/generatepwd/
├── cli.py # CLI command definitions
├── main.py # Entry point for the application
├── complexity.py # Defines complexity levels and strategies
├── distribution.py # Calculates character distribution
├── generator.py # Generates password using strategies
├── validators.py # Validates user inputs
├── password_exceptions.py # Custom exceptions for errors
└── print_handler.py # Colored CLI output handling
Contributing
Contributions, issues, and feature requests are welcome. Please open an issue or submit a pull request.
License
MIT License
Copyright (c) 2025 Sriram Dhanaraj
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 generatepwd-1.0.0.tar.gz.
File metadata
- Download URL: generatepwd-1.0.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e443dc7b4ee4d3aa598e8afbdababac5cb0c52390c0506671e9c53e5c060fdd3
|
|
| MD5 |
9aa079aa418e9c045580540bc9a20624
|
|
| BLAKE2b-256 |
8e614e8dc9f9cc06e59bed90cc2106477cf96dec7c6c310b278046d365e72a08
|
File details
Details for the file generatepwd-1.0.0-py3-none-any.whl.
File metadata
- Download URL: generatepwd-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ace17a8fd6ecdf5f78c8588c5996d5306b59dc4f4f946e9556d17fb70b05d81
|
|
| MD5 |
7bf3a1ec8c29d3a662bf64961e0ed800
|
|
| BLAKE2b-256 |
d163d2d8d5280bd8d14d1b38be62c555f28304827588cdd2094d3ecc09f8bd7d
|