minos.cli.importlib module

class minos.cli.importlib.FunctionLoader[source]

Bases: object

Function Loader class.

classmethod load_many_from_directory(names, directory_path)[source]

Load multiple functions.

Parameters
  • names (list[str]) – The function names.

  • directory_path (pathlib.Path) – The directory path.

Return type

dict[str, collections.abc.Callable]

Returns

A mapping from function name to function itself.

static load_module_from_file(file_path)[source]

Load a module from file path.

Parameters

file_path (pathlib.Path) – The module’s file path.

Return type

module

Returns

A module.

classmethod load_one_from_directory(name, directory_path)[source]

Load one function.

Parameters
  • name (str) – The function name.

  • directory_path (pathlib.Path) – The directory path.

Return type

collections.abc.Callable

Returns

A function.