Skip to main content
https://img.shields.io/pypi/pyversions/markovname https://github.com/bicobus/pyMarkovNameGenerator/actions/workflows/tests.yml/badge.svg

pyMarkovNameGenerator

Markov chain-based name generator based on Sam Twidale implementation in Haxe. consider this work to be a python port with functionnally the same level of functionality. Feed it a list of training data, and it’ll spew out a bunch of new words.

It comes with the training data compiled by Sam, and made available under Creative Commons BY-NC 4.0.

If you appreciate this work, consider buying me a coffee.

Install using:

pip install markovname

Requirements

This software has been developped and tested with python 3.9. Any earlier version might not work.

A minor dependency on wcwidth, make sure it is installed using pip, your package manager or whatever method you are familiar with. It is only necessary if you plan to use the main module. If you’re only interested in the generator, then wcwidth can be ignored.

If you have poetry available, you can initialize a virtual environment with:

poetry install

Usage

The software reads sample data from json formatted datasets. See the data folder of this repository for examples.

usage: __main__.py [-h] [--list] [-n NUMBER] [-o ORDER] [-p PRIOR] [-g KEY] [-V] DATA

positional arguments:
  DATA                  Path containing the data sets.

optional arguments:
  -h, --help            show this help message and exit
  --list                List the various dataset available to the software.
                        (default: False)
  -n NUMBER, --number NUMBER
                        Amount of names to generate. (default: 1)
  -o ORDER, --order ORDER
                        Highest order of model to use. Will use Katz's back-
                        off model. It looks for the next letter based on the
                        last "n" letters. (default: 3)
  -p PRIOR, --prior PRIOR
                        The prior adds a constant probability that a random
                        letter is picked from the alphabet when generating a
                        new letter. Must be a number between 0 and 1.
                        (default: 0)
  -g KEY, --generate KEY
                        Which dataset to use. If not specified, use a random
                        available set instead. (default: None)
  -V, --version         show program's version number and exit

Release files for markovname 1.0.0

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

Source distribution (sdist)

Source distribution for markovname 1.0.0
File Size Uploaded
markovname-1.0.0.tar.gz 199.8 kB Details

Built distribution (wheel)

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

Total release size: 409.5 kB

Release files / markovname-1.0.0.tar.gz

Download URL markovname-1.0.0.tar.gz
Size 199.8 kB
Tags Source
SHA-256 checksum
How to use checksums
083e08aed1cda82be1f530b1ebf83fb5d50dde4472ca73e61e379dc3274ed36f
BLAKE2b-256 checksum
How to use checksums
02d2e4a1b63dc9c1ff4653a05fa377a3969b7ee37f41b375d5936d205c5dc534
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.6 Linux/5.10.0-8-amd64

Release files / markovname-1.0.0-py3-none-any.whl

Download URL markovname-1.0.0-py3-none-any.whl
Size 209.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bed299b44c7dcc1d552bc116846d3b94f651bcfea9685367b3b584e2801db36
BLAKE2b-256 checksum
How to use checksums
bc8a5576f2d9ff7e1bf628a314c607aee98528a1377a6b701aed3b7d2dfc66f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.6 Linux/5.10.0-8-amd64

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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