predictor_api_client package

Subpackages

Submodules

predictor_api_client.client module

class predictor_api_client.client.PredictorApiClient(host=None, port=None, verify=None, timeout=None, logging_configuration=None)[source]

Bases: object

Class implementing the lightweight client app for the Predictor API

property access_token
property address
data_wrapper

alias of predictor_api_client.utils.data.DataWrapper

host = 'http://127.0.0.1'
log_in(username, password)[source]

Logs-in an existing user in the predictor API.

Parameters
  • username (str) – username

  • password (str) – password

Returns

(data/error_info, status_code)

Return type

tuple

logging_configuration = {'class': 'logging.handlers.TimedRotatingFileHandler', 'kwargs': {'backupCount': 365, 'encoding': 'utf8', 'filename': '/home/docs/checkouts/readthedocs.org/user_builds/predictor-api-client/envs/latest/lib/python3.9/site-packages/predictor_api_client/../../logs/2021_11_26_client.log', 'interval': 1, 'when': 'midnight'}}
property login_endpoint
property password
port = 5000
predict(access_token, refresh_token, model_identifier, feature_values, feature_labels=None)[source]

Calls .predict(…) on a predictor (model) via the API.

Parameters
  • access_token (str, optional) – access token

  • refresh_token (str) – refresh token

  • model_identifier (str) – model identifier

  • feature_values (numpy.array) – feature values

  • feature_labels (list, optional) – feature labels, defaults to None

Returns

(data/error_info, status_code)

Return type

tuple

property predict_endpoint
predict_proba(access_token, refresh_token, model_identifier, feature_values, feature_labels=None)[source]

Calls .predict_proba(…) on a predictor (model) via the API.

Parameters
  • access_token (str, optional) – access token

  • refresh_token (str) – refresh token

  • model_identifier (str) – model identifier

  • feature_values (numpy.array) – feature values

  • feature_labels (list, optional) – feature labels, defaults to None

Returns

(data/error_info, status_code)

Return type

tuple

property predict_proba_endpoint
refresh_access_token(refresh_token)[source]

Refreshes an access token in the predictor API.

Parameters

refresh_token (str) – refresh token

Returns

(data/error_info, status_code)

Return type

tuple

property refresh_endpoint
refresh_required_errors = [<HTTPStatus.UNAUTHORIZED: 401>, <HTTPStatus.UNPROCESSABLE_ENTITY: 422>]
property refresh_token
sign_up(username, password)[source]

Signs-up a new user in the predictor API.

Parameters
  • username (str) – username

  • password (str) – password

Returns

(data/error_info, status_code)

Return type

tuple

property signup_endpoint
timeout = 2
property username
verify = True

Module contents