benchmarkstt.api.jsonrpc module

Make benchmarkstt available through a rudimentary JSON-RPC interface

Warning

Only supported for Python versions 3.6 and above!

class benchmarkstt.api.jsonrpc.DefaultMethods[source]

Bases: object

static help(methods)[source]
static version()[source]

Get the version of benchmarkstt

Return str:BenchmarkSTT version
class benchmarkstt.api.jsonrpc.MagicMethods[source]

Bases: object

static is_safe_path(path)[source]

Determines whether the file or path is within the current working directory :param str|PathLike path: :return: bool

load(name, module)[source]

Load all possible callbacks for a given module

Parameters:
  • name --
  • module (Module) --
possible_path_args = ['file', 'path']
register(name, callback)[source]

Register a callback as an api call :param name: :param callback:

serve(config, callback)[source]

Responsible for creating a callback with proper documentation and arguments signature that can be registered as an api call.

Parameters:
  • config --
  • callback --
Returns:

callable

exception benchmarkstt.api.jsonrpc.SecurityError[source]

Bases: ValueError

Trying to do or access something that isn't allowed

benchmarkstt.api.jsonrpc.get_methods() → jsonrpcserver.methods.Methods[source]

Returns the available JSON-RPC api methods

Returns:jsonrpcserver.methods.Methods