Clone of the Moby/Docker random name generator as a Python package.
Installation
$ pip install names_generator
Or, with uv:
$ uv add names_generator
Usage
Python API
The API only really consists of a single function.
>>> from names_generator import generate_name
>>> generate_name()
'vigorous_goldstine'
Customize the formatting of the name by specifying a style, one of plain, capital, hyphen, or underscore (default).
>>> generate_name(style='capital')
'Hardcore Thompson'
Pin a seed value for the underlying PRNG to reproduce a given name. A seed is applied to a dedicated PRNG instance, so it never disturbs the global random state on your behalf.
>>> generate_name(seed=42) == generate_name(seed=42)
True
Note that a seed only guarantees reproducibility within a given release. Whenever the underlying name listings change to stay in sync with upstream, some seeds will map to a different name.
Command-line
The package also exposes a basic command-line interface for scripting outside of Python
$ names-generator
clever_matsumoto
$ names-generator --style=capital
Heuristic Einstein
$ names-generator --help
Usage:
names-generator [-h] [-v] [--style NAME]
Generate random name pairing.
Options:
-s, --style NAME Formatting (default: underscore).
-h, --help Show this message and exit.
-v, --version Show the version and exit.
Documentation and issue tracking at:
https://github.com/glentner/names_generator
Because the command matches the distribution name, you can run it without installing anything:
$ uvx names-generator
clever_matsumoto
The command was originally installed as generate_name. That name is still installed and behaves identically, but names-generator is the canonical one and is what the documentation uses.
Development
This project uses uv.
$ uv sync
$ uv run pytest -v --cov
Upstream
The name listings in names_generator/names.py are a direct port of internal/namesgenerator from the Moby project, kept in the same order so the two can be diffed mechanically.
Upstream declared the listing frozen, so no new names are accepted here either. Changes to names.py are only made to bring this port back in sync with upstream.
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 names_generator-0.4.0.tar.gz.
File metadata
- Download URL: names_generator-0.4.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c49046a7c0ab435aa0dfcc8b0bf79b98e8422ad0e1337a1ebaa838224ea72091
|
|
| MD5 |
07b92220f6c382a07f49739430ad11ae
|
|
| BLAKE2b-256 |
8f3ad34ba188e24e3dae163b612ed856715f3bfded5c49bdba23023f56524278
|
Provenance
The following attestation bundles were made for names_generator-0.4.0.tar.gz:
Publisher:
publish.yml on glentner/names_generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
names_generator-0.4.0.tar.gz -
Subject digest:
c49046a7c0ab435aa0dfcc8b0bf79b98e8422ad0e1337a1ebaa838224ea72091 - Sigstore transparency entry: 2412307674
- Sigstore integration time:
-
Permalink:
glentner/names_generator@58c60187459f82337f995900503ac0d80add9956 -
Branch / Tag:
refs/tags/0.4.0 - Owner: https://github.com/glentner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@58c60187459f82337f995900503ac0d80add9956 -
Trigger Event:
release
-
Statement type:
File details
Details for the file names_generator-0.4.0-py3-none-any.whl.
File metadata
- Download URL: names_generator-0.4.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b63610ef5f867197e02d77b9026445dae97dd9277ff8bccac4c8c98d98dfc74
|
|
| MD5 |
ea56f67fe494ff26c14fff817518afde
|
|
| BLAKE2b-256 |
79d712a52256e98dd4751d12752c570bc7bcbc5bbb4457cbad25e04de4dfd632
|
Provenance
The following attestation bundles were made for names_generator-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on glentner/names_generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
names_generator-0.4.0-py3-none-any.whl -
Subject digest:
8b63610ef5f867197e02d77b9026445dae97dd9277ff8bccac4c8c98d98dfc74 - Sigstore transparency entry: 2412307689
- Sigstore integration time:
-
Permalink:
glentner/names_generator@58c60187459f82337f995900503ac0d80add9956 -
Branch / Tag:
refs/tags/0.4.0 - Owner: https://github.com/glentner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@58c60187459f82337f995900503ac0d80add9956 -
Trigger Event:
release
-
Statement type: