Skip to main content

py-friendly-words

PyPI version PyPI - Downloads Development

Python package to generate random human-readable strings, e.g. project and experiment names. The word lists are taken from glitchdotcom/friendly-words and the package provides a convenient way to access it, as well as methods to easily generate combinations.

The package is simple, limited, and over-engineered at the same time. In other words, a weekend night side project. If you need a stable package with more extensive customization, uniqueness guarantees, bigger and/or custom dictionaries, check out alexanderlukanin13/coolname.

Features

  • No extra dependencies
  • Word lists are loaded once at import (~41KB in memory)
  • Customizable generation (see the examples below)
  • Custom separators
  • Can return as a list of words
  • Reproducible generation with your own random.Random instance
  • Fully typed public API

Quick guide

Install with PIP: pip install friendlywords

import friendlywords as fw

# generate random string that consists of N words (N > 0)
# if N is 1, the returned word is an object
# if N > 1, the first N-1 words are predicates
fw.generate(1)
>>> 'square'
fw.generate(4)
>>> 'southern florentine rain college'

# generate string that follow a given grammar
# p = predicate, o = object, t = team, c = collection
fw.generate('po')
>>> 'bittersweet curio'
fw.generate('pt')
>>> 'wood organization'
fw.generate('co')
>>> 'selection title'

# specify the separator
fw.generate('po', separator='-')
>>> 'better-tabletop'
fw.generate('ppp', separator=', ')
>>> 'elegant, skitter, sunny'
fw.generate(3, separator='/')
>>> 'winter/alkaline/handsaw' 

# return list of words instead of a string (ignores separator keyword)
fw.generate(5, as_list=True)
>>> ['laced', 'polyester', 'ossified', 'cyclic', 'chronometer']
fw.generate('pppoc', as_list=True)
>>> ['able', 'splendid', 'harvest', 'hedge', 'playlist']

# reproducible generation without touching the global random state
import random
fw.generate('po', rng=random.Random(42))
>>> 'tidal cardboard'

# lists of all predicates, objects, teams or collections
fw.predicates, fw.objects, fw.teams, fw.collections
>>> ['windy', ...], ['turnip', ...], ['alliance', ...], ['album', ...]

Notes

  • For reproducible output, pass your own random.Random instance via the rng keyword (setting the global random.seed() also still works).
  • The words are sampled with a non-cryptographic PRNG, so the generated names are readable, not unguessable — don't use them as secrets or unique identifiers.
  • fw.preload() is deprecated and is no longer needed: word lists are always loaded at import.

Metadata

Release files for friendlywords 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for friendlywords 1.3.0
File Size Uploaded
friendlywords-1.3.0.tar.gz 27.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for friendlywords 1.3.0
File Interpreter ABI Platform
friendlywords-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.7 kB

Release files / friendlywords-1.3.0.tar.gz

Download URL friendlywords-1.3.0.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d6532b8d535b8d4dc55a774cbe9f2ad83e7d17a982dc8ac9e5d24a6b82fc664a
BLAKE2b-256 checksum
How to use checksums
2e2cddec5e055b54d2e48b4cba7fd7248fb8a0412ad5bb5348984b1ec33a51af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Release files / friendlywords-1.3.0-py3-none-any.whl

Download URL friendlywords-1.3.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99997dcab437ad0465b7df8f5e4b99f33216ddb05a5079e0d27e80c13cb82ae1
BLAKE2b-256 checksum
How to use checksums
702cce3dab9e7d2feb084dc96ce8079b6ea10d351287638493d6107f54be3066
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page