Skip to main content

pypi build status coverage documentation

Do you want random human-readable strings?

>>> from coolname import generate_slug
>>> generate_slug()
'big-maize-lori-of-renovation'
>>> generate_slug()
'tunneling-amaranth-rhino-of-holiness'
>>> generate_slug()
'soft-cuddly-shrew-of-expertise'

Features

  • Generate slugs, ready to use, Django-compatible.

    >>> from coolname import generate_slug
    >>> generate_slug()
    'qualified-agama-of-absolute-kindness'
  • Generate names as sequences and do whatever you want with them.

    >>> from coolname import generate
    >>> generate()
    ['beneficial', 'bronze', 'bee', 'of', 'glee']
    >>> ' '.join(generate())
    'limber transparent toad of luck'
    >>> ''.join(x.capitalize() for x in generate())
    'CalmRefreshingTerrierOfAttraction'
  • Generate names of specific length: 2, 3 or 4 words.

    >>> generate_slug(2)
    'mottled-crab'
    >>> generate_slug(3)
    'fantastic-acoustic-whale'
    >>> generate_slug(4)
    'military-diamond-tuatara-of-endeavor'

    Note: without argument, it returns a random length, but probability of 4‑word name is much higher. Prepositions and articles (of, from, the) are not counted as words.

  • Use in command line:

    $ coolname
    prophetic-tireless-bullfrog-of-novelty
    $ coolname 3 -n 2 -s '_'
    wildebeest_of_original_champagne
    ara_of_imminent_luck
  • Over 1010 random names.

    Words

    Combinations

    Example

    4

    1010

    talented-enigmatic-bee-of-hurricane

    3

    108

    ambitious-turaco-of-joviality

    2

    105

    prudent-armadillo

    >>> from coolname import get_combinations_count
    >>> get_combinations_count(4)
    61032399092
  • Hand-picked vocabulary. sexy and demonic are about the most “offensive” words here - but there is only a pinch of them, for spice. Most words are either neutral, such as red, or positive, such as brave. And subject is always some animal, bird, fish, or insect - you can’t be more neutral than Mother Nature.

  • Easy customization. Create your own rules!

    >>> from coolname import RandomGenerator
    >>> generator = RandomGenerator({
    ...   'all': {
    ...     'type': 'cartesian',
    ...     'lists': ['first_name', 'last_name']
    ...   },
    ...   'first_name': {
    ...     'type': 'words',
    ...     'words': ['james', 'john']
    ...   },
    ...   'last_name': {
    ...     'type': 'words',
    ...     'words': ['smith', 'brown']
    ...   }
    ... })
    >>> generator.generate_slug()
    'james-brown'

Installation

pip install coolname

coolname is written in pure Python and has no dependencies. It works on any modern Python version (3.6+), including PyPy.

Release history

2.1.0 (2022-12-07)

  • Support OpenSSL FIPS by using hashlib.md5(..., usedforsecurity=False)

2.0.0 (2022-10-24)

  • Support for old Python versions (<3.5) is dropped, because it’s 2022

  • Command line usage and pipx support.

  • With additional owls and bitterns

1.1.0 (2018-08-02)

  • 32-bit Python is supported.

1.0.4 (2018-02-17)

  • Breaking changes:

    • Renamed RandomNameGenerator to RandomGenerator.

    • randomize was removed, because it was just an alias to random.seed.

  • Phrase lists give you even more freedom when creating custom generators.

  • You can seed or even replace the underlying random.Random instance, see Randomization.

  • Change the default generator using COOLNAME_DATA_DIR and COOLNAME_DATA_MODULE. This also saves memory!

  • Total number of combinations = 60 billions.

For earlier releases, see History

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coolname-2.1.0.tar.gz (58.3 kB view details)

Uploaded Source

Built Distribution

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

coolname-2.1.0-py2.py3-none-any.whl (37.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file coolname-2.1.0.tar.gz.

File metadata

  • Download URL: coolname-2.1.0.tar.gz
  • Upload date:
  • Size: 58.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for coolname-2.1.0.tar.gz
Algorithm Hash digest
SHA256 8a605be9e48b261ac50e9f258c40adcd4081b9ca0e6f08d39511f77cb2ae55ba
MD5 a1dd6b9acb21493323f81cec2116aeea
BLAKE2b-256 32581132eaeeaf52ff3b52a1a4b4a715552f95dd796131ed9024791969b9cb94

See more details on using hashes here.

File details

Details for the file coolname-2.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: coolname-2.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for coolname-2.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e30a311aa8a1d3fe1a7da290ca65b4ac81927c3e91dcc18f179462e9204f01b0
MD5 03c5baf4bace32e9a9703e639f6b473e
BLAKE2b-256 2af3315a93134a47754731129d1d66ac89b2edf12644c58c9370221053f959fb

See more details on using hashes here.

Release history Release notifications | RSS feed

5.0.0

2 files

4.2.0

2 files

4.1.0

2 files

4.0.0

2 files

3.0.0

2 files

2.2.0

2 files

This release

2.1.0 This release

2 files

2.0.0

2 files

1.1.0

2 files

1.0.4

2 files

0.2.1

1 file

0.1.1

2 files

0.1.0

1 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