Skip to content

Alladin9393/statprly

Repository files navigation

STATPRLY

Release PyPI version shields.io Build Status CodeFactor

PyPI pyversions

STATPRLY - is a python package with recognition tools.

Set of tools:

* Bayesian recognition digit based on standards

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 statprly

Usage

Bayesian Recognition Digit

Recognize random digit with noise:

import numpy

from statprly import MonoDigitRecognizer

if __name__ == '__main__':
    recognizer = MonoDigitRecognizer()
    noise = 0.1
    with open('path_to_digit_to_recognize') as f:
        digit_to_predict = f.read()
    
    digit_to_predict = numpy.array(digit_to_predict)
    recognized_digit = recognizer.recognize(
        digit_to_predict_data=digit_to_predict,
        noise_probability=noise,
    )

    print(recognized_digit)    

Recognize random digit with noise with data from Pattern Recognition Server:

Install requirements to interact with server:

$ pip3 install websockets

Example code can be found here: Link to github gist.

Development

Clone the project and move to project folder:

$ git clone https://github.com/Alladin9393/statprly.git && cd statprly

Create virtualenv and install requirements:

$ virtualenv venv -p python3 && source venv/bin/activate
$ pip3 install -r requirements/development.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 statprly && rm -rf dist/ statprly.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.