Skip to main content

A random name generation script.

Project description

A Python package for building names by using other names as building blocks.

What Does mkname Do?

mkname uses a database of names to randomly generate names:

>>> import mkname
>>>
>>> mkname.pick_name(kind='surname')
['Phan']
>>> mkname.pick_name(kind='given', gender='male', num_names=4)
['Henry', 'Hector', 'Jimmie', 'Giovanni']
>>> mkname.create_compound_name(culture='United States', gender='male')
['Damuel']
>>> mkname.create_syllable_name(4)
['Betmahuret']

If you just want to generate a name and you don’t want to write any code around generating it, mkname can also be run from the command line:

$ mkname pick
Cheryl
$ mkname compound
Awilson

You can access help on using mkname from the command line by using the -h option:

$ mkname -h

usage: mkname [-h] mode ...

Generate a random names or read data from a names database.

positional arguments:
...

Features

The main features of mkname are:

  • Select a random name from the names database.

  • Modify generated names with mod functions.

  • Customize name generation by creating your own names database.

  • Add name generation to your Python code with the`mkname` package.

  • Generate names at the command line with the mkname tool.

Installation

mkname is available for install from PyPI with pip or your favorite package manager:

$ pip3 install mkname

The source code is available on GitHub if you’d rather install it that way: mkname.

What Changed in Version 0.2.4

The following changes were made in v0.2.4:

  • Moved dependency management to poetry.

  • Added ability to list the genders assigned to the names.

  • Added ability to duplicate the names database for customization.

  • Added tools for adding names to a names database.

  • Added mkname_tools script for administering the names database.

  • Explicitly pointing to a non-existent database will no longer create a new names database in that location.

  • Added new API functions that manage the database and configuration for you.

  • More documentation!

mkname and Cultural Bias

Names are influenced by the culture and experience of those doing the naming. What sounds like a plausible name to me may not sound like a plausible name to you. Even worse, what seems like an acceptable name to my may be offensive to you. mkname is sticking pieces of names together at random, it’s very possible the output could have undesirable connotations in its final context.

The default names database supplied with mkname is unavoidably biased by my culture, experience, and the data I could find. To make mkname more useful to more people, it also has the ability to use custom names databases you create. The mkname.tools module and the mkname_tools command line tool have features to help with this.

There are a few concepts like “letters,” “consonants,” and “vowels” that are baked in right now but may not work for all languages and cultures. If you find these are interfering with your use of mkname, please feel free to open an issue on it. I can’t promise anything because I’m just one person doing this on my free time, but I’ll see what I can do.

‘mkname’ Test Package

Testing is automated with a combination of make, pytest, and tox. To run a quick set of tests that just check against your current version of Python:

make test

To get the verbose output:

make testv

To run the full suite of pre-commit tests:

make pre

Project details


Download files

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

Source Distribution

mkname-0.2.5.tar.gz (101.8 kB view details)

Uploaded Source

Built Distribution

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

mkname-0.2.5-py3-none-any.whl (93.9 kB view details)

Uploaded Python 3

File details

Details for the file mkname-0.2.5.tar.gz.

File metadata

  • Download URL: mkname-0.2.5.tar.gz
  • Upload date:
  • Size: 101.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mkname-0.2.5.tar.gz
Algorithm Hash digest
SHA256 5537889b6c7f64b23877724a99cee60cae7e34c67b3e68bc83e4a497931bf040
MD5 3e3713981d0737c38884eac88919140e
BLAKE2b-256 d48b033e5e74a40a7f7e753b957ff9a64c0214b94c043ed168630aaa8109ca74

See more details on using hashes here.

File details

Details for the file mkname-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: mkname-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 93.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mkname-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 066566d511292a844080bb32a9ffaf5d072a2631efff89bb2b024604dbb6664a
MD5 5855fbd7a649fc4f276add835f71cc8b
BLAKE2b-256 c276ee95d4d7a4c5588bd1f172c4d1b88a5f96d39200c3d9880e235a29564b59

See more details on using hashes here.

Supported by

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