Skip to main content

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

pyfwert-0.1.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

pyfwert-0.1.0-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file pyfwert-0.1.0.tar.gz.

File metadata

  • Download URL: pyfwert-0.1.0.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

Hashes for pyfwert-0.1.0.tar.gz
Algorithm Hash digest
SHA256 878ce02b1284bb9b909c8deb015f240b63c56d64a015f25f515cc0e6ef1c9aae
MD5 3498dd5f674c102063b6abc78c9fe6cc
BLAKE2b-256 16135325fb304a9f0327538d4928f91da21b70ede0bbecdbe2d32933a4d21c7d

See more details on using hashes here.

File details

Details for the file pyfwert-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyfwert-0.1.0-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

Hashes for pyfwert-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b19c62d965acd24f666388ae0267a62e2a57abfbf2b7a240e399346d235953e
MD5 29d5924363b8a50160132fe06c8d2e0b
BLAKE2b-256 940844362e7ab8a2e9d113126b8504ba5ceee27fc5bfdbfd6defe13f48fe1023

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