Skip to main content

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

  1. Clone the repository:

    git clone https://github.com/yourusername/genpass.git
    cd genpass
    
  2. (Optional) Create and activate a virtual environment:

    python -m venv venv
    venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. (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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

generatepwd-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

generatepwd-1.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

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

Hashes for generatepwd-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e443dc7b4ee4d3aa598e8afbdababac5cb0c52390c0506671e9c53e5c060fdd3
MD5 9aa079aa418e9c045580540bc9a20624
BLAKE2b-256 8e614e8dc9f9cc06e59bed90cc2106477cf96dec7c6c310b278046d365e72a08

See more details on using hashes here.

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

Hashes for generatepwd-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ace17a8fd6ecdf5f78c8588c5996d5306b59dc4f4f946e9556d17fb70b05d81
MD5 7bf3a1ec8c29d3a662bf64961e0ed800
BLAKE2b-256 d163d2d8d5280bd8d14d1b38be62c555f28304827588cdd2094d3ecc09f8bd7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page