friendlywords

raw JSON →
1.2.0 verified Fri May 01 auth: no python

A Python library for generating random human-readable strings, such as project names, experiment names, or memorable identifiers. Version 1.2.0 supports Python >=3.6 and provides two-word combinations from adjective-noun pairs. The package is actively maintained with a stable API.

pip install friendlywords
error AttributeError: module 'friendlywords' has no attribute 'generate'
cause Using 'import friendlywords' instead of 'from friendlywords import generate'
fix
Change to: from friendlywords import generate
error ModuleNotFoundError: No module named 'friendlywords'
cause Package not installed
fix
Run: pip install friendlywords
gotcha The generate() function returns a string with a hyphen by default, not a tuple or list. Users expecting multiple words may need to split on '-' or call generate(separator=' ').
fix Use generate(separator=' ') for space-separated output, or call .split('-') if hyphen is used.
deprecated The older import pattern 'import friendlywords' may work but is not recommended; the correct API requires 'from friendlywords import generate'. Future versions may drop the top-level module.
fix Change import to: from friendlywords import generate
gotcha The library does not provide a way to generate more than two words. All outputs are exactly an adjective and a noun.
fix If you need longer strings, call generate() multiple times and join with a separator.

Generate a single random human-readable string (adjective-noun pair).

from friendlywords import generate

# Generate a random friendly word pair
result = generate()
print(result)  # e.g., 'happy-eagle'