Skip to main content

mkname

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

Metadata

Release files for mkname 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkname 0.2.5
File Size Uploaded Provenance Actions
mkname-0.2.5.tar.gz 101.8 kB Without provenance Details for mkname-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mkname 0.2.5
File Interpreter ABI Platform Actions
mkname-0.2.5-py3-none-any.whl Python 3 none any Details for mkname-0.2.5-py3-none-any.whl

Total release size: 195.7 kB

Release files / mkname-0.2.5.tar.gz

Download URL mkname-0.2.5.tar.gz
Size 101.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5537889b6c7f64b23877724a99cee60cae7e34c67b3e68bc83e4a497931bf040
BLAKE2b-256 checksum
How to use checksums
d48b033e5e74a40a7f7e753b957ff9a64c0214b94c043ed168630aaa8109ca74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / mkname-0.2.5-py3-none-any.whl

Download URL mkname-0.2.5-py3-none-any.whl
Size 93.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
066566d511292a844080bb32a9ffaf5d072a2631efff89bb2b024604dbb6664a
BLAKE2b-256 checksum
How to use checksums
c276ee95d4d7a4c5588bd1f172c4d1b88a5f96d39200c3d9880e235a29564b59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for mkname 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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