A pattern-based password generator that creates strong, memorable passwords
Project description
Pyfwert
A pattern-based password generator that creates strong, memorable passwords.
Pyfwert is a Python port of the Pafwert VB6 password generator. Unlike random generators that produce strings like "KBYd4ie*2", Pyfwert generates passwords like "bone.horse.berner" or "Miss. Undercarriage" using pattern templates and extensive wordlists.
Installation
pip install pyfwert
Quick Start
from pyfwert import generate_password
# Generate a simple password
password = generate_password("{word}.{word}.{word}")
# Example output: "bone.horse.berner"
# Generate with numbers and symbols
password = generate_password("{word}{number(99)}{symbol}")
# Example output: "dragon42!"
# Generate with modifiers
password = generate_password("{word+uppercase}-{word+obscure}")
# Example output: "THUNDER-h0rs3"
Advanced Usage
from pyfwert import PasswordGenerator
# Create a generator with custom wordlist directory
gen = PasswordGenerator(wordlist_dir="/path/to/wordlists")
# Generate with various patterns
password = gen.generate("{word(animal)+propercase} {word(color)}")
# Example output: "Horse blue"
# Use backreferences
password = gen.generate("{number(9)}{$W1}{$W1}")
# Example output: "777"
Pattern Syntax
Patterns use placeholders enclosed in curly braces {...}:
Basic Placeholders
{word}- Random word from default wordlist{word(animal)}- Random word from specific wordlist{number}- Random digit (0-9){number(99)}- Random number (0-99){number(100,999)}- Random number in range{symbol}- Random symbol{letter}- Random letter{vowel}- Random vowel{consonant}- Random consonant{pronounceable}- Fake pronounceable word{sequence(5)}- Keyboard sequence of length 5
Modifiers
Add modifiers with +:
+uppercase/+ucase- Convert to uppercase+lowercase/+lcase- Convert to lowercase+propercase- Capitalize first letter+randomcase- Random capitalization+obscure- L33t-speak substitutions+reverse- Reverse the text+bracket- Wrap in brackets+piglatin- Convert to pig latin+scramble- Scramble letters+num2words- Convert number to words
Selection Groups
Use | for random selection:
"{word|number|symbol}" # Randomly picks word, number, or symbol
"{Mr.|Mrs.|Ms.}" # Randomly picks a title
Qualifiers
Use [N] for percentage chance:
"{word[50]}" # 50% chance of including a word
"{symbol[25]}" # 25% chance of including a symbol
Backreferences
Use $W1, $W2, etc. to reference previous placeholders:
"{number(9)}{$W1}{$W1}" # Repeats the same digit: "777"
Escape Characters
\\- Literal backslash\{- Literal opening brace\}- Literal closing brace\+- Literal plus sign
License
Apache 2.0 - See LICENSE for details.
Credits
Original Pafwert by Mark Burnett (2001-2013). Python port created in 2026.
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
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 pyfwert-0.1.2.tar.gz.
File metadata
- Download URL: pyfwert-0.1.2.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0fddc41d1ab184cf4945315e1bff0262eb275dd339fbd215c48e1cb4cafd998
|
|
| MD5 |
088595e1db6a355ac43a7a0efbefbdb2
|
|
| BLAKE2b-256 |
8df14ff0066e75daf60a381b88d953cbd32222198c2eea74063caa7076d1fa9f
|
File details
Details for the file pyfwert-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pyfwert-0.1.2-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30aba518e14955e29c1c9ad150e24004b31c4f6cc09ccb90f6c33bea8357bc67
|
|
| MD5 |
85581542f89c22ef5f9add5672daf0c0
|
|
| BLAKE2b-256 |
b2a05dd47f1d76f3732f14a748716a07a9d5ca2e7320acaa6a0e12e52981965d
|