Command linesΒΆ

  1. Creates an falcon application and starts it through a wsgi application

  2. Creates an falcon application to store machine learned models

  3. Encrypts password

  4. Uploads a machine model

Creates an falcon application and starts it through a wsgi application

Creates an falcon application and starts it through a wsgi server.

<<<

python -m lightmlrestapi start_mlrestapi --help

>>>

usage: start_mlrestapi [-h] [-n NAME] [-ho HOST] [-p PORT] [-no NOSTART]
                       [-w WSGI] [-o OPTIONS] [-s SECRET] [-c CCALL]
                       [-u USERS]

Creates an `falcon` application and runs it through a `wsgi` server.

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  class name or filename which defines the application
                        (default: dummy)
  -ho HOST, --host HOST
                        host (default: 127.0.0.1)
  -p PORT, --port PORT  port (default: 8081)
  -no NOSTART, --nostart NOSTART
                        do not start the wsgi server (default: False)
  -w WSGI, --wsgi WSGI  `wsgi` framework which runs the falcon application
                        (default: waitress)
  -o OPTIONS, --options OPTIONS
                        additional options as a string (depends on the
                        application) (default: )
  -s SECRET, --secret SECRET
                        secret used to encrypt the logging, default is empty
                        which disables the encryption (default: )
  -c CCALL, --ccall CCALL
                        calling convention, 'single', 'multi' or 'both'
                        depending on the fact that the prediction function can
                        predict for only one observation, multiple ones or
                        both (default: single)
  -u USERS, --users USERS
                        registred users, file with two columns login,
                        encrypted password, and no header (default: )

(original entry : make_ml_app.py:docstring of lightmlrestapi.cli.make_ml_app.start_mlrestapi, line 23)

Creates an falcon application to store machine learned models

Creates an falcon application and starts it through a wsgi server. The appplication stores machine learned models and runs predictions assuming all the necessary packages were installed.

<<<

python -m lightmlrestapi start_mlreststor --help

>>>

usage: start_mlreststor [-h] [-l LOCATION] [-ho HOST] [-p PORT] [-n NAME]
                        [-no NOSTART] [-w WSGI] [-s SECRET] [-u USERS]
                        [-a ALGO]

Creates an `falcon` application and runs it through a `wsgi` server. The
appplication stores machine learned models and runs predictions assuming all
the necessary packages were installed.

optional arguments:
  -h, --help            show this help message and exit
  -l LOCATION, --location LOCATION
                        location of the storage (default: .)
  -ho HOST, --host HOST
                        host (default: 127.0.0.1)
  -p PORT, --port PORT  port (default: 8081)
  -n NAME, --name NAME  only one option is implemented 'ml' (default: ml)
  -no NOSTART, --nostart NOSTART
                        do not start the wsgi server (for debug purpose)
                        (default: False)
  -w WSGI, --wsgi WSGI  `wsgi` framework which runs the falcon application
                        (default: waitress)
  -s SECRET, --secret SECRET
                        secret used to encrypt the logging, default is empty
                        which disables the encryption (default: )
  -u USERS, --users USERS
                        list of authorized users stored in a text file with
                        two columns: login and encrypted password (default: )
  -a ALGO, --algo ALGO  algorithm used to encrypt the passwords (default:
                        sha224)

(original entry : make_ml_store.py:docstring of lightmlrestapi.cli.make_ml_store.start_mlreststor, line 25)

Encrypts password

Encrypts passwords for a REST API created by lightmlrestapi.

<<<

python -m lightmlrestapi encrypt_pwd --help

>>>

usage: encrypt_pwd [-h] [-i INPUT] [-o OUTPUT] [-a ALGO]

Encrypts passwords to setup a REST API with *lightmlrestapi*.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        file containing two columns <login>,<clear password>
                        (comma separated values), no header, encoding is
                        *utf-8* (default: )
  -o OUTPUT, --output OUTPUT
                        file containing two columns <login>,<encrypted
                        password>, csv, encoding is *utf-8* (default: )
  -a ALGO, --algo ALGO  algorithm used to hash the passwords (default: sha224)

(original entry : make_encrypt_pwd.py:docstring of lightmlrestapi.cli.make_encrypt_pwd.encrypt_pwd, line 11)

Uploads a machine model

Uploads a machine learned model to a REST API created with lightmlrestapi. The code of this command line is equivalent to:

from lightmlrestapi.netrest import submit_rest_request, json_upload_model
req = json_upload_model(name=name, pyfile=pyfile, data=data)
submit_rest_request(req, login=login, pwd=pwd, url=url)

<<<

python -m lightmlrestapi upload_model --help

>>>

usage: upload_model [-h] [-l LOGIN] [--pwd PWD] [-n NAME] [-p PYFILE]
                    [-d DATA] [--url URL] [-t TIMEOUT]

Uplaods a machine learned models to a REST API defined by
:class:`MLStoragePost <lightmlrestapi.mlapp.mlstorage_rest.MLStoragePost>`.

optional arguments:
  -h, --help            show this help message and exit
  -l LOGIN, --login LOGIN
                        user login (default: )
  --pwd PWD             user pasword (default: )
  -n NAME, --name NAME  name of the model, should be unique and not already
                        used (default: )
  -p PYFILE, --pyfile PYFILE
                        python file which computes the prediction, the file
                        must follows the specification defined in
                        :ref:`l-template-ml` (default: )
  -d DATA, --data DATA  files to upload (default: )
  --url URL             url of the REST API (default: 127.0.0.1:8081)
  -t TIMEOUT, --timeout TIMEOUT
                        timeout (default: 50)

(original entry : make_ml_upload.py:docstring of lightmlrestapi.cli.make_ml_upload.upload_model, line 15)