coolname


Namecoolname JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/alexanderlukanin13/coolname
SummaryRandom name and slug generator
upload_time2022-12-07 14:17:12
maintainer
docs_urlNone
authorAlexander Lukanin
requires_python
licenseBSD
keywords coolname
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            ==============================
Random Name and Slug Generator
==============================

|pypi| |build| |coverage| |docs|

Do you want random human-readable strings?

.. code-block:: python

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

    .. code-block:: python

        >>> from coolname import generate_slug
        >>> generate_slug()
        'qualified-agama-of-absolute-kindness'

* Generate names as sequences and do whatever you want with them.

    .. code-block:: python

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

    .. code-block:: python

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

    .. code-block:: bash

        $ coolname
        prophetic-tireless-bullfrog-of-novelty
        $ coolname 3 -n 2 -s '_'
        wildebeest_of_original_champagne
        ara_of_imminent_luck

* Over 10\ :sup:`10`\  random names.

    ===== ============== =======================================
    Words Combinations   Example
    ===== ============== =======================================
    4     10\ :sup:`10`\ ``talented-enigmatic-bee-of-hurricane``
    3     10\ :sup:`8`\  ``ambitious-turaco-of-joviality``
    2     10\ :sup:`5`\  ``prudent-armadillo``
    ===== ============== =======================================

    .. code-block:: python

        >>> 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 <http://coolname.readthedocs.io/en/latest/customization.html>`_. Create your own rules!

    .. code-block:: python

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

.. code-block:: bash

    pip install coolname

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


.. |pypi| image:: https://img.shields.io/pypi/v/coolname.svg
    :target: https://pypi.python.org/pypi/coolname
    :alt: pypi

.. |build| image:: https://api.travis-ci.org/alexanderlukanin13/coolname.svg?branch=master
    :target: https://travis-ci.org/alexanderlukanin13/coolname?branch=master
    :alt: build status

.. |coverage| image:: https://coveralls.io/repos/alexanderlukanin13/coolname/badge.svg?branch=master&service=github
    :target: https://coveralls.io/github/alexanderlukanin13/coolname?branch=master
    :alt: coverage

.. |docs| image:: https://img.shields.io/readthedocs/coolname.svg
    :target: http://coolname.readthedocs.io/en/latest/
    :alt: documentation




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 <https://coolname.readthedocs.io/en/latest/customization.html#phrases-list>`_
  give you even more freedom when creating custom generators.

* You can seed or even replace the underlying ``random.Random`` instance, see
  `Randomization <https://coolname.readthedocs.io/en/latest/randomization.html>`_.

* 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 <https://coolname.readthedocs.io/en/latest/history.html>`_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alexanderlukanin13/coolname",
    "name": "coolname",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "coolname",
    "author": "Alexander Lukanin",
    "author_email": "alexander.lukanin.13@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/32/58/1132eaeeaf52ff3b52a1a4b4a715552f95dd796131ed9024791969b9cb94/coolname-2.1.0.tar.gz",
    "platform": null,
    "description": "==============================\nRandom Name and Slug Generator\n==============================\n\n|pypi| |build| |coverage| |docs|\n\nDo you want random human-readable strings?\n\n.. code-block:: python\n\n    >>> from coolname import generate_slug\n    >>> generate_slug()\n    'big-maize-lori-of-renovation'\n    >>> generate_slug()\n    'tunneling-amaranth-rhino-of-holiness'\n    >>> generate_slug()\n    'soft-cuddly-shrew-of-expertise'\n\nFeatures\n========\n\n* Generate slugs, ready to use, Django-compatible.\n\n    .. code-block:: python\n\n        >>> from coolname import generate_slug\n        >>> generate_slug()\n        'qualified-agama-of-absolute-kindness'\n\n* Generate names as sequences and do whatever you want with them.\n\n    .. code-block:: python\n\n        >>> from coolname import generate\n        >>> generate()\n        ['beneficial', 'bronze', 'bee', 'of', 'glee']\n        >>> ' '.join(generate())\n        'limber transparent toad of luck'\n        >>> ''.join(x.capitalize() for x in generate())\n        'CalmRefreshingTerrierOfAttraction'\n\n* Generate names of specific length: 2, 3 or 4 words.\n\n    .. code-block:: python\n\n        >>> generate_slug(2)\n        'mottled-crab'\n        >>> generate_slug(3)\n        'fantastic-acoustic-whale'\n        >>> generate_slug(4)\n        'military-diamond-tuatara-of-endeavor'\n\n    *Note: without argument, it returns a random length, but probability of 4\u2011word name is much higher.*\n    *Prepositions and articles (of, from, the) are not counted as words.*\n\n* Use in command line:\n\n    .. code-block:: bash\n\n        $ coolname\n        prophetic-tireless-bullfrog-of-novelty\n        $ coolname 3 -n 2 -s '_'\n        wildebeest_of_original_champagne\n        ara_of_imminent_luck\n\n* Over 10\\ :sup:`10`\\  random names.\n\n    ===== ============== =======================================\n    Words Combinations   Example\n    ===== ============== =======================================\n    4     10\\ :sup:`10`\\ ``talented-enigmatic-bee-of-hurricane``\n    3     10\\ :sup:`8`\\  ``ambitious-turaco-of-joviality``\n    2     10\\ :sup:`5`\\  ``prudent-armadillo``\n    ===== ============== =======================================\n\n    .. code-block:: python\n\n        >>> from coolname import get_combinations_count\n        >>> get_combinations_count(4)\n        61032399092\n\n* Hand-picked vocabulary. ``sexy`` and ``demonic`` are about the most \"offensive\" words here -\n  but there is only a pinch of them, for spice. Most words are either neutral, such as ``red``, or positive,\n  such as ``brave``. And subject is always some animal, bird, fish, or insect - you can't be more neutral than\n  Mother Nature.\n\n* `Easy customization <http://coolname.readthedocs.io/en/latest/customization.html>`_. Create your own rules!\n\n    .. code-block:: python\n\n        >>> from coolname import RandomGenerator\n        >>> generator = RandomGenerator({\n        ...   'all': {\n        ...     'type': 'cartesian',\n        ...     'lists': ['first_name', 'last_name']\n        ...   },\n        ...   'first_name': {\n        ...     'type': 'words',\n        ...     'words': ['james', 'john']\n        ...   },\n        ...   'last_name': {\n        ...     'type': 'words',\n        ...     'words': ['smith', 'brown']\n        ...   }\n        ... })\n        >>> generator.generate_slug()\n        'james-brown'\n\nInstallation\n============\n\n.. code-block:: bash\n\n    pip install coolname\n\n**coolname** is written in pure Python and has no dependencies. It works on any modern Python version (3.6+), including PyPy.\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/coolname.svg\n    :target: https://pypi.python.org/pypi/coolname\n    :alt: pypi\n\n.. |build| image:: https://api.travis-ci.org/alexanderlukanin13/coolname.svg?branch=master\n    :target: https://travis-ci.org/alexanderlukanin13/coolname?branch=master\n    :alt: build status\n\n.. |coverage| image:: https://coveralls.io/repos/alexanderlukanin13/coolname/badge.svg?branch=master&service=github\n    :target: https://coveralls.io/github/alexanderlukanin13/coolname?branch=master\n    :alt: coverage\n\n.. |docs| image:: https://img.shields.io/readthedocs/coolname.svg\n    :target: http://coolname.readthedocs.io/en/latest/\n    :alt: documentation\n\n\n\n\nRelease history\n===============\n\n2.1.0 (2022-12-07)\n------------------\n\n* Support OpenSSL FIPS by using ``hashlib.md5(..., usedforsecurity=False)``\n\n2.0.0 (2022-10-24)\n------------------\n\n* Support for old Python versions (<3.5) is dropped, because it's 2022\n\n* Command line usage and pipx support.\n\n* With additional owls and bitterns\n\n1.1.0 (2018-08-02)\n------------------\n\n* 32-bit Python is supported.\n\n1.0.4 (2018-02-17)\n------------------\n\n* **Breaking changes:**\n\n    - Renamed ``RandomNameGenerator`` to ``RandomGenerator``.\n\n    - ``randomize`` was removed, because it was just an alias to ``random.seed``.\n\n* `Phrase lists <https://coolname.readthedocs.io/en/latest/customization.html#phrases-list>`_\n  give you even more freedom when creating custom generators.\n\n* You can seed or even replace the underlying ``random.Random`` instance, see\n  `Randomization <https://coolname.readthedocs.io/en/latest/randomization.html>`_.\n\n* Change the default generator using ``COOLNAME_DATA_DIR`` and ``COOLNAME_DATA_MODULE``. This also saves memory!\n\n* Total number of combinations = 60 billions.\n\n\nFor earlier releases, see `History <https://coolname.readthedocs.io/en/latest/history.html>`_\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Random name and slug generator",
    "version": "2.1.0",
    "split_keywords": [
        "coolname"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "03c5baf4bace32e9a9703e639f6b473e",
                "sha256": "e30a311aa8a1d3fe1a7da290ca65b4ac81927c3e91dcc18f179462e9204f01b0"
            },
            "downloads": -1,
            "filename": "coolname-2.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "03c5baf4bace32e9a9703e639f6b473e",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 37184,
            "upload_time": "2022-12-07T14:17:09",
            "upload_time_iso_8601": "2022-12-07T14:17:09.400351Z",
            "url": "https://files.pythonhosted.org/packages/2a/f3/315a93134a47754731129d1d66ac89b2edf12644c58c9370221053f959fb/coolname-2.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a1dd6b9acb21493323f81cec2116aeea",
                "sha256": "8a605be9e48b261ac50e9f258c40adcd4081b9ca0e6f08d39511f77cb2ae55ba"
            },
            "downloads": -1,
            "filename": "coolname-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a1dd6b9acb21493323f81cec2116aeea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 58327,
            "upload_time": "2022-12-07T14:17:12",
            "upload_time_iso_8601": "2022-12-07T14:17:12.275667Z",
            "url": "https://files.pythonhosted.org/packages/32/58/1132eaeeaf52ff3b52a1a4b4a715552f95dd796131ed9024791969b9cb94/coolname-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-07 14:17:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "alexanderlukanin13",
    "github_project": "coolname",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": false,
    "tox": true,
    "lcname": "coolname"
}
        
Elapsed time: 0.04588s