util module

check_response_errors

edgeimpulse.util.check_response_errors(
		request
)

Check for standard errors and raise an exception with the details if found.

Parameters

  • request

configure_generic_client

edgeimpulse.util.configure_generic_client(
		key: str,
		key_type: str = 'api',
		host: str = 'https://studio.edgeimpulse.com/v1'
)> edgeimpulse_api.api_client.ApiClient

Configure generic api client which the right key.

Parameters

  • key: str

  • key_type: str = 'api'

  • host: str = 'https://studio.edgeimpulse.com/v1'

Return

edgeimpulse_api.api_client.ApiClient

connect_websocket

edgeimpulse.util.connect_websocket(
		token,
		host: str = None
)> socketio.client.Client

Connects to the websocket server.

Parameters: token (str): The authentication token. host (str, optional): The hostname. If None, API_ENDPOINT will be used.

Returns: object: Websocket object.

Parameters

  • token

  • host: str = None

Return

socketio.client.Client

default_project_id_for

edgeimpulse.util.default_project_id_for(
		client: edgeimpulse_api.api_client.ApiClient
)> int

Derive project id from api_key used to configure generic client.

Parameters

  • client: edgeimpulse_api.api_client.ApiClient

Return

int

encode_file_as_base64

edgeimpulse.util.encode_file_as_base64(
		filename: str
)

Envode a file as base64.

Parameters

  • filename: str

get_organization_websocket

edgeimpulse.util.get_organization_websocket(
		client,
		organization_id: int,
		host: str = None
)> socketio.client.Client

Gets a websocket to listen to organization events.

Parameters

  • client

  • organization_id: int

  • host: str = None

Return

socketio.client.Client