Skip to main content

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

Project description

EOS Name Generator

Build Status CodeFactor codecov

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

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.1.0.tar.gz (49.1 kB view hashes)

Uploaded Source

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