documentation
2.4 KiB
🚀 PyPassword Generator
A beginner-friendly Python program that generates a password from the number of letters, symbols and numbers you ask for.
📚 Table of Contents
🧭 Overview
Day 5 of Udemy's 100 Days of Code™: The Complete Python Pro Bootcamp, practising loops and the random module.
The program starts with a colored ASCII-art title (colors are skipped when the output is not a terminal or the NO_COLOR environment variable is set). It then asks how many letters, symbols and numbers you want and prints two passwords:
- Easy level – characters are appended in order: letters, then symbols, then numbers.
- Hard level – the characters are collected in a list and mixed with
random.shuffle()so the order is completely random.
📋 Requirements
- Python 3.13 or newer
- No runtime dependencies (the standard library is enough)
pytest(only for running the tests)
🛠️ Setup
Create and activate a local virtual environment named .venv, then install the project in editable mode together with the test extra.
Windows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
Windows (cmd):
python -m venv .venv
.venv\Scripts\activate.bat
macOS / Linux / Git Bash:
python3 -m venv .venv
source .venv/bin/activate # Git Bash on Windows: source .venv/Scripts/activate
Then install:
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
Run deactivate to leave the environment.
The .env file (access tokens for repository tooling) is ignored by git and is not needed to run the program.
▶️ Run
python -m password_generator
or, after installing:
password-generator
🧪 Tests
python -m pytest
📄 License
GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).
