Skip to main content
https://img.shields.io/travis/alexanderlukanin13/coolname.svg https://img.shields.io/pypi/v/coolname.svg https://coveralls.io/repos/alexanderlukanin13/coolname/badge.svg?branch=master&service=github

Do you want random human-readable strings to identify things?

>>> 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.

  • 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)
    51560093424
    
  • 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 RandomNameGenerator
    >>> generator = RandomNameGenerator({
    ...   '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.

History

0.2.0 (2016-09-28)

  • More flexible configuration: max_length and max_slug_length constraints. See documentation.

  • Total number of combinations increased from 43 to 51 billions.

0.1.1 (2015-12-17)

  • Consistent behavior in Python 2/3: output is always unicode.

  • Provide from coolname.loader import load_config as a public API for loading custom configuration.

  • More strict configuration validation.

  • Total number of combinations increased from 33 to 43 billions.

0.1.0 (2015-11-03)

  • First release on PyPI.

Download files

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

Source Distribution

coolname-0.2.1.tar.gz (44.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: coolname-0.2.1.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for coolname-0.2.1.tar.gz
Algorithm Hash digest
SHA256 237d618c5f4dbc862179ce9aa7a97a26fdd6295f98206c39aeec267d2fb4509e
MD5 643dae6d95e8ec844dd75f3deb9f8279
BLAKE2b-256 84ebe84029bbfc26d52d9a4a688e961e0a1b8c0bf65ff46dcb5169d79608d1bf

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

2.1.0

2 files

2.0.0

2 files

1.1.0

2 files

1.0.4

2 files

This release

0.2.1 This release

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