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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfwert-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7b24a551594b1b7be957b45ad44397a29f54e3200c8148f03d36e8d7bd7599ca
MD5 773594d5331bba152e027c8f62bcc9b3
BLAKE2b-256 fed6a8196476c7493ee6375e088c40c519fb108e13ca2c0fcfbbb30a5fda22a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfwert-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 574f9bd990d125f68d51c571599b95bc4fc09c1e6669c9434716e546e9bbccd9
MD5 57cdfb8fa448f91b50665a9bb106899c
BLAKE2b-256 535a4a375ff437761c381608e1e318353061095ba5a5a7283f6984980f90cdcd

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