module cli.make_ml_app

Short summary

module lightmlrestapi.cli.make_ml_app

Creates and runs an Falcon application.

source on GitHub

Functions

function

truncated documentation

_get_app

Get application.

start_mlrestapi

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

Documentation

Creates and runs an Falcon application.

source on GitHub

lightmlrestapi.cli.make_ml_app._get_app(name, options, secret, users)

Get application.

source on GitHub

lightmlrestapi.cli.make_ml_app.start_mlrestapi(name='dummy', host='127.0.0.1', port=8081, nostart=False, wsgi='waitress', options='', secret='', ccall='single', users='', fLOG=<built-in function print>)

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

Parameters:
  • name – class name or filename which defines the application

  • host – host

  • port – port

  • nostart – do not start the wsgi server

  • wsgiwsgi framework which runs the falcon application

  • options – additional options as a string (depends on the application)

  • 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

  • secret – secret used to encrypt the logging, default is empty which disables the encryption

  • users – registred users, file with two columns login, encrypted password, and no header

  • fLOG – logging function

Only waitress is implemented right now. Other alternative such as mod_wsgi with Apache. uwsgi are not implemented.

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: )

source on GitHub