A secure and customizable strong password generator script built in Python. Generate high-quality passwords with options for length, character types, and readability.
- Overview
- Features
- Requirements
- Installation
- Usage
- Code Structure
- Security Notes
- Contributing
- License
This Python script lets users quickly generate random, secure passwords via CLI. It’s customizable and ideal for both personal use and integration into larger automation workflows.
- Customizable length (default: 16 characters)
- Mix of uppercase, lowercase, digits, and symbols
- Option to exlude similar-looking characters (e.g.,
O,0,l,1) - Choice to avoid ambiguous symbols for better readability
- Easily embeddable as a function or module in other Python projects
- Python 3.7+
- No external dependencies—just the Python standard library
git clone https://github.com/MisaghMomeniB/Password-Generator-Python.git
cd Password-Generator-Python
python3 --version # ensure Python ≥3.7Run the script directly with customizable options:
python3 password_generator.py --length 20 --no-ambiguous --no-similarOptions:
--length <int>: Set password length (default16)--no-ambiguous: Exclude punctuation that’s hard to read--no-similar: Skip characters like0,O,l,1--count <int>: Generate multiple passwords in one run
Import generate_password() in your code:
from password_generator import generate_password
pwd = generate_password(length=24, no_ambiguous=True)
print("Generated password:", pwd)/ (root)
├── password_generator.py # CLI script & core logic
└── README.md # This file
generate_password(): main function with customizable optionsif __name__ == "__main__":block handles CLI parsing viaargparse
- Uses
secrets.SystemRandom()for cryptographic-quality randomness - Ensures a mix of character types by design
- Avoids insecure
randommodule
Improvements welcome! Suggested enhancements:
- Add pronounceable password mode
- Integrate password strength estimation
- GUI or web-based interface
To contribute:
- Fork the repository
- Create a new branch (
feature/...) - Submit a detailed pull request