Skip to main content

Random name and slug generator

Project description

pypi build status coverage documentation

Do you want random human-readable strings?

>>> from coolname import generate_slug
>>> generate_slug()
>>> generate_slug()
>>> generate_slug()


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

    >>> from coolname import generate_slug
    >>> generate_slug()
  • 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())
  • Generate names of specific length: 2, 3 or 4 words.

    >>> generate_slug(2)
    >>> generate_slug(3)
    >>> generate_slug(4)

    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.

  • 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)
  • 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()


pip install coolname

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

Release history

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

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
coolname-1.1.0-py2.py3-none-any.whl (35.3 kB) Copy SHA256 hash SHA256 Wheel py2.py3
coolname-1.1.0.tar.gz (55.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page