项目作者: Alladin9393

项目描述 :
Random EOS name generator python package.
高级语言: Python
项目地址: git://github.com/Alladin9393/eos-name-generator.git
创建时间: 2020-05-22T13:03:24Z
项目社区:https://github.com/Alladin9393/eos-name-generator

开源协议:MIT License

下载


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:

  1. * Random Generator
  2. * Recurrent Neural Network Generator
  3. * 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:

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

MacOS

Install Python 3.7 (also, we support 3.6):

  1. $ brew install python3

Installation

Install the package from the PyPi through pip:

  1. $ 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:

  1. $ eos-name-generator --version

Random Generator

Generate random name:

  1. from eos_name_generator import RandomNameGenerator
  2. if __name__ == '__main__':
  3. generator = RandomNameGenerator()
  4. name = generator.generate()
  5. print(name)

Generate list of random names:

  1. from eos_name_generator import RandomNameGenerator
  2. if __name__ == '__main__':
  3. generator = RandomNameGenerator()
  4. names = generator.generate_list(num=1000)
  5. for name in names:
  6. 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.
  1. $ eos-name-generator generate name
  2. brakesroller
Generate with numpy-random-provider:
  1. $ eos-name-generator generate name --numpy-random-provider
  2. sightsilicon
Generate with numbers-probability:
  1. $ eos-name-generator generate name --numbers-probabilities 1
  2. barges143525
Generate with custom seed data:
  1. $ eos-name-generator generate name --seed-data-path data.txt
  2. 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.
  1. $ eos-name-generator generate names_list --num 4
  2. marblesmeats
  3. seamanhiring
  4. wonderbreast
  5. mosseshealth
Generate with numpy-random-provider:
  1. $ eos-name-generator generate names_list --num 4 --numpy-random-provider
  2. candyhalibut
  3. strollscales
  4. folklorepink
  5. slaveryrotor
Generate with numbers-probability:
  1. $ eos-name-generator generate names_list --num 4 --numbers-probabilities 1
  2. doorbell3321
  3. sycamore1553
  4. chaplain3431
  5. combine25115
Generate with custom seed data:
  1. $ eos-name-generator generate names_list --num 4 --seed-data-path data.txt
  2. dessertsuede
  3. reboundbrown
  4. heaterssalad
  5. doubterpoach

Development

Clone the project and move to project folder:

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

Create virtualenv and install requirements:

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

To run tests use:

  1. $ 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:

  1. $ pip3 uninstall -y eos_name_generator && rm -rf dist/ eos_name_generator.egg-info && \
  2. 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.

  1. $ python3 setup.py sdist
  2. $ twine upload dist/*
  3. username: alladin9393
  4. 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.