Skip to content

About

CLI Password Generator — A Python command-line tool that generates cryptographically secure passwords using the secrets module. Supports custom length, character sets, bulk generation, and clipboard copy. Includes a strength checker and full pytest test suite. Zero required dependencies.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🔐 Password Generator

A fast, flexible command-line password generator written in Python.
Uses Python's secrets module for cryptographically secure randomness.


✨ Features

  • Cryptographically secure — powered by secrets.token_bytes
  • Fully customisable: length, character sets, count
  • Strength indicator on every password
  • Optional clipboard copy (--copy)
  • Zero external dependencies by default
  • Full test suite with pytest

🚀 Quick Start

# Clone the repo
git clone https://github.com/YOUR_USERNAME/password-generator.git
cd password-generator

# Run with defaults (16-char password)
python password_generator.py

Output:

  Password:    x$K7mN!qR2pL@wYv
  Strength:    🟢 Very Strong

🛠️ Usage

python password_generator.py [OPTIONS]
Option Description Default
-l N, --length N Password length 16
-n N, --count N Number of passwords 1
--no-uppercase Exclude A–Z off
--no-digits Exclude 0–9 off
--no-symbols Exclude special chars off
--copy Copy first password to clipboard off

Examples

# 24-character password
python password_generator.py -l 24

# Generate 5 passwords at once
python password_generator.py -n 5

# Letters + digits only (no symbols)
python password_generator.py --no-symbols

# 32-char password, copied to clipboard
python password_generator.py -l 32 --copy

🧪 Running Tests

pip install pytest
python -m pytest tests/ -v

📦 Optional Dependencies

Package Purpose Install
pyperclip --copy flag pip install pyperclip

📁 Project Structure

password-generator/
├── password_generator.py   # Core logic + CLI
├── tests/
│   └── test_password_generator.py
├── requirements.txt
├── .gitignore
└── README.md

📄 License

MIT License — free to use, modify, and distribute.

About

CLI Password Generator — A Python command-line tool that generates cryptographically secure passwords using the secrets module. Supports custom length, character sets, bulk generation, and clipboard copy. Includes a strength checker and full pytest test suite. Zero required dependencies.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages