httk.serve.web.functions.python_module¶
Load and invoke site-local Python function modules safely.
Classes¶
Load cached site function modules and invoke their public facades. |
Module Contents¶
- class httk.serve.web.functions.python_module.PythonFunctionHandler(functions_dir)[source]¶
Load cached site function modules and invoke their public facades.
- Parameters:
functions_dir (pathlib.Path) – Directory containing trusted site function modules.
- execute(*, function_name, params, global_data)[source]¶
Execute a site function with request parameters and global data.
- Parameters:
- Returns:
Value returned by the module’s
executefacade.- Raises:
FileNotFoundError – If the function module does not exist.
ValueError – If the module path or execute facade is invalid.
- Return type:
Any
- execute_provider(*, provider_name, context, request, provider_args)[source]¶
Call a contained site function module’s explicit
providefacade.- Parameters:
- Returns:
Value returned by the module’s
providefacade.- Raises:
FileNotFoundError – If the provider module does not exist.
ValueError – If the module or provider signature is invalid.
- Return type:
Any