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.3.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.3-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfwert-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 e6b608a6b81af283c99caad9f5ea34bb358afb5f75da1cf73e2408c772a28c87
MD5 d70922652f54aaf7c361f08d18b87605
BLAKE2b-256 3b1df3b6bf017e10cd29d27c36b0678e61f2cbe4b00b28ca8a0e920d7135ff91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfwert-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32a9691c449e41593658273180c1bd697b21a49538338592512367a36a461b67
MD5 3934de4fc522b5cb9a73c84b3f2dcd6b
BLAKE2b-256 9f32ffc2e2c9cdca84682bd763ac9b7ade5eb7fa961ed3ed22ff605ae46dc64f

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