Generate memorable, rhyming passphrases with an interactive terminal picker.
Project description
rhymepass
Generate memorable, rhyming passphrases from the CMU Pronouncing Dictionary, with an interactive terminal picker.
The underground parade / an undelivered accolade / 38
My yearning tailor / its xenial whaler / 67
Those nimble amyloid / such gentle android / 16
Each passphrase is a rhyming couplet built from real English words, padded with light filler words, plus two random digits. Readable, pronounceable, easy to transcribe, and awkward to guess.
Need raw entropy instead - say, for a legacy field that caps at 8 characters, or anywhere a memorable phrase is overkill? Press m in the picker to flip into random mode: the same UX in violet, generating fixed-length passwords drawn from a curated, shell-/HTTP-safe character set.
KvR3@m,Lp9-T_eXq.j2bA:cN8
H§p.7-eR4z@nQ,sB
Install
From PyPI:
pip install rhymepass
With uv:
uv pip install rhymepass
Or as a development checkout:
git clone https://github.com/synmux/rhymepass.git
cd rhymepass
uv sync
uv run rhymepass
Requires Python 3.11 or newer. Clipboard copy works on macOS (via pbcopy), Linux (via wl-copy, xclip, or xsel — install one through your package manager if none are present), and Windows (via clip).
Usage
Two commands land the same tool on your $PATH:
rhymepass- the canonical name.rp- a short alias.
In a terminal
rhymepass # picker, 5 rhyming phrases (default)
rhymepass 10 # picker with 10 phrases
rhymepass --help # full option summary
rhymepass --version # print the installed version
Every interactive picker control is also reachable as a CLI flag. The flags become the opening state of the picker (or the configuration of the one-shot pipe path); inside the picker, the same controls remain available as key bindings.
| Option | What it does |
|---|---|
[count] |
How many passphrases to generate. Default 5, must be ≥ 1. |
-m, --mode {rhyme,random} |
Generation mode. rhyme (default) builds memorable couplets; random builds fixed-length passwords from a curated character set. |
-l, --limit N |
Length constraint. Rhyme mode: maximum total length, must be 0 (no limit) or ≥ 9. Random mode: exact length, must be 0 (default 24) or ≥ the number of enabled classes. |
--spaces / --no-spaces |
Show or hide interior spaces in rhyme output. Defaults to showing spaces. No-op in random mode. |
-c, --classes CSV |
Comma-separated random-mode character classes. Choose any non-empty subset of upper,lower,digits,safe,all. Defaults to upper,lower,digits,safe. Rejected in rhyme mode. |
--interactive / --no-interactive |
Force the picker on or off. By default the picker is shown when stdout is a TTY. |
-v, --version |
Print the installed version and exit. |
-h, --help |
Print the help summary and exit. |
A few common one-liners:
rhymepass --mode random 1 # one 24-char random password
rhymepass -m random -l 16 5 # five 16-char random passwords
rhymepass -m random -c upper,digits 8 # eight uppercase+digit passwords
rhymepass -m random -c upper,lower,digits,all 1 # one max-entropy password
rhymepass --no-spaces 3 | pbcopy # rhymes with no interior spaces
rhymepass -l 24 5 # five rhymes, each ≤ 24 chars
In the picker
When stdout is a TTY (and --no-interactive is not set), rhymepass opens an interactive picker. Use the arrow keys to highlight a passphrase, then press enter - the selected passphrase is copied to your clipboard and the tool exits. CLI flags become the opening state, so rhymepass --mode random --limit 32 --classes upper,digits opens directly in random mode at limit 32 with that charset; the keys below still mutate the state interactively.
| Key | What it does |
|---|---|
↑ / ↓ |
Move the highlight. |
enter |
Copy the highlighted passphrase and exit. |
x |
Toggle whether spaces are shown (rhyme mode only). The per-row character count and the strength indicator both update to reflect the displayed form, since that is the password you would actually copy. The character limit, however, is always enforced against the spaced form, so toggling is safe. |
l |
Prompt for a character limit. 0 means no limit (the default). In rhyme mode the minimum is 9 characters ("Abcd / 12"); in random mode the minimum drops to 4. The batch regenerates so every passphrase fits the new limit. |
m |
Toggle between rhyme mode (memorable couplets, the default) and random mode (fixed-length passwords from a–z A–Z 0–9 @-_.,:§). Random mode flips the accent colour to violet so it is always obvious which mode is active. |
1–5 |
Random mode only. Toggle character classes used by the random generator. [1] Upper, [2] Lower, [3] Digits, [4] Safe symbols (@-_.,:§), [5] All symbols (the safe set plus more dangerous symbols). Enabling 5 auto-enables 4; disabling 4 auto-disables 5. The charset bar at the top shows the current state and the batch regenerates instantly on every toggle. |
r |
Regenerate the batch with the current settings. |
esc / q |
Exit without copying anything. |
Each row in the picker ends with a strength indicator built from zxcvbn. The score (0–4) is rendered as an emoji followed by " | " and a one-to-five star run:
| Score | Indicator |
|---|---|
| 0 | 🤮 | ⭐ |
| 1 | ☹️ | ⭐⭐ |
| 2 | 🫤 | ⭐⭐⭐ |
| 3 | 😀 | ⭐⭐⭐⭐ |
| 4 | 🥳 | ⭐⭐⭐⭐⭐ |
Under a tight character budget the picker first drops filler words from the rhyming couplet, then (below ~16 characters) falls back to a single-statement form like Half dally / 17. The " / NN" two-digit suffix is always preserved.
In random mode the limit is interpreted as the exact length (with 0 meaning the default of 24). Every output is guaranteed to contain at least one character from each currently-enabled class, with the remaining slots drawn uniformly from the union of those classes and the final order shuffled with secrets.SystemRandom. The "safe symbols" set is @-_.,:§ - characters that have no special meaning in shells, URLs, regex, or common form-validation rules - so generated passwords paste cleanly into command lines, web forms, and config files without quoting. The "all symbols" toggle extends that with every other ASCII punctuation character (! " # $ % & ' ( ) * + / ; < = > ? [ \ ] ^ \ { | } ~`) for cases where the receiving system accepts the full set and you want maximum entropy.
The minimum length the modal accepts in random mode is the number of currently-enabled classes (since each one contributes a guaranteed character): one class lets you go as low as 1, all five enabled bumps the minimum to 5.
Weak-strength warning. When a character limit is active in rhyme mode, the generator walks progressively shorter output forms to fit each couplet under the cap, narrowing the phonetic and lexical choices at each step. If any passphrase in the current batch scores 4 stars or below (zxcvbn score ≤ 3), the picker shows a warning toast suggesting you switch to random mode (press m). In random mode the limit is the exact output length, so every character position contributes uniformly to entropy and the tradeoff disappears.
In a pipe
When stdout is not a TTY, rhymepass skips the picker and just prints one passphrase per line. The interactive Textual dependency is never imported on this path, so pipe invocations start fast and stay light.
The strength indicator is written to stderr, one line per passphrase, while passphrases themselves go to stdout. Pipes and redirections that consume stdout therefore receive only the password, while an attached terminal still sees the indicators interleaved. If stderr is also redirected away from a TTY (for example rhymepass 5 > file 2>/dev/null), scoring is skipped entirely - no wasted zxcvbn work for output nobody will see.
When --limit is active in rhyme mode and any passphrase in the batch scores 4 stars or below, an additional warning line is written to stderr (unconditionally - not gated on whether stderr is a TTY) suggesting --mode random as an alternative. stdout is unaffected; the passphrase lines remain clean.
rhymepass 3 | cat
# stdout (visible to cat):
# Those nimble amyloid / such gentle android / 16
# Our bold missourian / some hopeful centurion / 84
# Any tactile contemn / much calm condemn / 84
# stderr (visible only on the terminal):
# 🥳 | ⭐⭐⭐⭐⭐
# 🥳 | ⭐⭐⭐⭐⭐
# 🥳 | ⭐⭐⭐⭐⭐
stdout therefore contains exactly count lines, each a complete passphrase, with no header, blank lines, or other metadata. rhymepass 5 | head -1 is guaranteed to return the first passphrase.
As a library
from rhymepass import (
ALL_SYMBOLS,
DEFAULT_RANDOM_LEN,
DIGITS,
LOWERCASE,
SAFE_SYMBOLS,
UPPERCASE,
build_anchor_pool,
format_strength,
generate,
generate_random,
load_real_words,
score_passphrase,
)
# Rhyming flavour
real_words = load_real_words()
pool = build_anchor_pool(real_words)
phrase = generate(pool, real_words) # no length limit
print(generate(pool, real_words, limit=24)) # fit under 24 characters
score = score_passphrase(phrase) # 0..4 from zxcvbn
print(phrase, "|", format_strength(score)) # "<phrase> | 🥳 | ⭐⭐⭐⭐⭐"
# Random flavour - default classes (a-z, A-Z, 0-9, SAFE_SYMBOLS)
print(SAFE_SYMBOLS) # "@-_.,:§"
print(generate_random()) # DEFAULT_RANDOM_LEN (24) chars
print(generate_random(length=12)) # exactly 12 chars
# Custom classes - pick any non-empty subset
print(generate_random(length=8, classes=(UPPERCASE, DIGITS))) # uppercase + digits only
print(generate_random(length=24, classes=(LOWERCASE, UPPERCASE, DIGITS, ALL_SYMBOLS)))
load_real_words and build_anchor_pool are comparatively expensive; call them once per process and reuse the result for as many generate calls as you need. score_passphrase is fast (a few milliseconds per call) and safe to invoke per generation.
How it works
Anchor words come from the intersection of two dictionaries:
- the CMU Pronouncing Dictionary (via
pronouncing) for phonetic rhymes and syllable counts, - the GNU Collaborative International Dictionary of English (via
english-words) to exclude proper nouns, abbreviations, and obscure entries.
For every passphrase, rhymepass picks a random anchor, looks up phonetic rhymes, filters them through the same quality checks, and assembles two phrases by wrapping each anchor in zero, one, or two filler words drawn from a hand-curated list of determiners (the, some, every, …) and adjectives (nimble, radiant, zesty, …). A two-digit suffix (10–99) is appended to each passphrase.
All random choices use secrets rather than random, so the output is suitable for use as an actual passphrase - though you should still pair it with whatever additional entropy your threat model demands.
When a character limit is set, the generator descends through progressively shorter output forms for the same anchor before giving up and drawing a new one, so common limits (20–30 characters) succeed in a few attempts. See AGENTS.md for the exact descent strategy.
Dependencies
pronouncing≥ 0.3.0 - CMU Pronouncing Dictionary bindings.english-words≥ 2.0.2 - GCIDE word set for filtering.textual≥ 0.80 - terminal UI. Only imported on the interactive path.zxcvbn≥ 4.5.0 - realistic password-strength scoring used by the indicator.
See pyproject.toml for the exact pin set; the lock file covers transitive dependencies.
Limitations
- Clipboard requires a platform helper binary. macOS ships
pbcopyout of the box and Windows shipsclipsince Vista, so both work without extra setup. On Linux you need one ofwl-copy(from thewl-clipboardpackage, preferred on Wayland),xclip, orxsel. If none are available, the picker raisesRuntimeErrorwith a message naming the options; the generator itself (and the pipe/library paths) work without any clipboard tool. - No history. Each run produces a fresh batch; nothing is persisted between invocations.
Contributing
For architecture, internal conventions, and the complete list of gotchas, see AGENTS.md. Run the test suite with:
uv sync --extra dev
uv run pytest
Bug reports, feature ideas, and pull requests are welcome at https://github.com/synmux/rhymepass.
Licence
MIT - see LICENSE.
Project details
Release history Release notifications | RSS feed
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 rhymepass-0.1.1.tar.gz.
File metadata
- Download URL: rhymepass-0.1.1.tar.gz
- Upload date:
- Size: 69.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0934a3f38989d3fbe385d3b1d1db8d03413302d005228df09d778164a574df32
|
|
| MD5 |
c1626444189988a65b20db41776e7592
|
|
| BLAKE2b-256 |
602386d3c8fb49e87ef0f159c9c6bdf2d794aae0599c62e513cb2fabeb367d46
|
File details
Details for the file rhymepass-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rhymepass-0.1.1-py3-none-any.whl
- Upload date:
- Size: 41.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b743605136394245c83b8d18b0267d49bf4447ac8856bb45a654a17bcfdef775
|
|
| MD5 |
f5a6db0499190217084a929670e38c2e
|
|
| BLAKE2b-256 |
27222700b1df49348b0ccfdd22d01b5dafd198a32b862bf54219f169a5f9a139
|