Skip to main content

Python package for generation random name which suits `EOS` name conversations

Project description

EOS Name Generator

Release PyPI version shields.io Build Status CodeFactor codecov

PyPI license PyPI pyversions Downloads

EOS Name Generator - is a python package for generating names according to EOS name rules.

This includes 3 ways to generate a name:

* Random Generator
* Recurrent Neural Network Generator
* Markov Chain Generator

Getting started

Requirements

Ubuntu 16.04 & 18.04

If you have 16.04 version, install system requirements with the following terminal commands:

$ sudo apt update && sudo apt install -y software-properties-common build-essential

MacOS

Install Python 3.7 (also, we support 3.6):

$ brew install python3

Installation

Install the package from the PyPi through pip:

$ pip3 install eos-name-generator

Algorithm description

Random Generator

The algorithm selects a base word from a pre-prepared dictionary, after which an additional word of the appropriate length is selected ADDITIONAL_WORD_LEN = EOS_NAME_LEN - BASE_WORD_LEN if there is no such word, then the additional word is random numbers.

The probability that an additional word will be numbers can be set by the parameter numbers_probabilities.

Recurrent Neural Network Generator

Markov Chain Generator

EOS Name Rules

  • Can only contain the characters .abcdefghijklmnopqrstuvwxyz12345. a-z (lowercase), 1-5 and . (period)
  • Must start with a letter
  • Must be 12 characters

Usage

Service

Get the version of the package — eos-name-generator --version:

$ eos-name-generator --version

Random Generator

Generate random name:

from eos_name_generator import RandomNameGenerator

if __name__ == '__main__':
    generator = RandomNameGenerator()
    name = generator.generate()
    print(name)    

Generate list of random names:

from eos_name_generator import RandomNameGenerator

if __name__ == '__main__':
    generator = RandomNameGenerator()
    names = generator.generate_list(num=1000)
    
    for name in names:
        print(name)

Recurrent Neural Network Generator

Markov Chain Generator

CLI

Usage

Generate name

Generate eos random name - eos-name-generator generate name:

Arguments Type Required Description
numpy-random-provider Bool No Used numpy.random as random provider instance for generation name.
numbers-probabilities Float No The probability of occurrence of numbers in the generated word.
seed-data-path String No Path to the data based on which the name will be generated.
$ eos-name-generator generate name
brakesroller
Generate with numpy-random-provider:
$ eos-name-generator generate name --numpy-random-provider
sightsilicon
Generate with numbers-probability:
$ eos-name-generator generate name --numbers-probabilities 1
barges143525
Generate with custom seed data:
$ eos-name-generator generate name --seed-data-path data.txt
tamalecation

Generate list of names

Generate list of eos random names - eos-name-generator generate names_list:

Arguments Type Required Description
num Int Yes Number of generated names.
numpy-random-provider Bool No Used numpy.random as random provider instance for generation name.
numbers-probabilities Float No The probability of occurrence of numbers in the generated word.
seed-data-path String No Path to the data based on which the name will be generated.
$ eos-name-generator generate names_list --num 4
marblesmeats
seamanhiring
wonderbreast
mosseshealth
Generate with numpy-random-provider:
$ eos-name-generator generate names_list --num 4 --numpy-random-provider
candyhalibut
strollscales
folklorepink
slaveryrotor
Generate with numbers-probability:
$ eos-name-generator generate names_list --num 4 --numbers-probabilities 1
doorbell3321
sycamore1553
chaplain3431
combine25115
Generate with custom seed data:
$ eos-name-generator generate names_list --num 4 --seed-data-path data.txt
dessertsuede
reboundbrown
heaterssalad
doubterpoach

Development

Clone the project and move to project folder:

$ git clone https://github.com/Alladin9393/eos-name-generator.git && cd eos-name-generator

Create virtualenv and install requirements:

$ virtualenv venv -p python3 && source venv/bin/activate
$ pip3 install -r requirements.txt -r requirements-dev.txt

To run tests use:

$ coverage run -m pytest -vv tests

When you have developed new functionality, check it with the following command. This command creates the Python package from source code instead of installing it from the PyPi:

$ pip3 uninstall -y eos_name_generator && rm -rf dist/ eos_name_generator.egg-info && \
      python3 setup.py sdist && pip3 install dist/*.tar.gz

Production

To build the package and upload it to PypI to be accessible through pip, use the following commands. Twine requires the username and password of the account package is going to be uploaded to.

$ python3 setup.py sdist
$ twine upload dist/*
username: alladin9393
password: ******

Contributing

Request pull request's review

If you want to your pull request to be review, ensure you:

If you want to your pull request to be review, ensure you:

  1. Branch isn't out-of-date with the base branch.
  2. Have written the description of the pull request and have added at least 2 reviewers.
  3. Continuous integration has been passed.

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

eos-name-generator-0.2.0.tar.gz (52.7 kB view details)

Uploaded Source

File details

Details for the file eos-name-generator-0.2.0.tar.gz.

File metadata

  • Download URL: eos-name-generator-0.2.0.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5

File hashes

Hashes for eos-name-generator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0f52cf961f35e0183d30d95ad97b3422caa2e417ee10f6bf433f01e795aac9b5
MD5 7fae75bbdbdd53a27c03e0d316c2184c
BLAKE2b-256 3109b8fd7c9bd9b6dc9dcc3d75ba0472e9f6836904c5b9b852ec975b002a60c4

See more details on using hashes here.

Supported by

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