Skip to main content
License PyPI Version Python Versions Downloads per month Tests

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

$ generate_name
clever_matsumoto

$ generate_name --style=capital
Heuristic Einstein

$ generate_name --help
Usage:
  generate_name [-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

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

names_generator-0.3.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

names_generator-0.3.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file names_generator-0.3.0.tar.gz.

File metadata

  • Download URL: names_generator-0.3.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for names_generator-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b2e3e4e3b671d23d258032f36994d9c1f7b827beca0fe618d24af995d3cceec6
MD5 0b2613a79d03f9b731d74cc5f57cf898
BLAKE2b-256 2075af4c36c018d495e0bb38dbb7084e7262122406a8c196739029cd69997745

See more details on using hashes here.

Provenance

The following attestation bundles were made for names_generator-0.3.0.tar.gz:

Publisher: publish.yml on glentner/names_generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file names_generator-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: names_generator-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for names_generator-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1790d3626d583450d8ba1110166fecd2e8dc12a428aee8195afa03410039b5b
MD5 35180dcd8802f201d3f970d0eb1768d3
BLAKE2b-256 ca84e4f63a753b2469a88486dc78ec0c58ff98a583d81456363f854f07e875a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for names_generator-0.3.0-py3-none-any.whl:

Publisher: publish.yml on glentner/names_generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page