StepRunner

A simple framework for running notebooks as steps with variables

source

StepRunner

 StepRunner (file_path:str, workspace:str|None=None,
             function:str|None=None, variables:dict[str,Any]|None=None)

environment variables set by stdflow: stdflow__run: if set, the step is executed from a pipeline run stdflow__run__files_path: names of the files executed split by : stdflow__run__ids: ids of the files executed split by : stdflow__run__function_name: name of the function executed stdflow__vars: variables used to run the function


source

StepRunner.run

 StepRunner.run (save_notebook:bool=False, kernel:Union[Literal[':current'
                 ,':target',':any_available'],str]=':target',
                 kernels_on_fail:Union[list,str]=None, verbose:bool=True,
                 **kwargs)

Run the function of the pipeline :arg: kernel: kernel name to use or :current to use the current kernel :target to use the kernel in the metadata of the target notebook, :any_available to use any available kernel :arg: kernels_on_fail: list of kernels to try if the kernel specified in kernel fails :arg: save_notebook (bool): whether to save the notebook after execution :arg: verbose (bool): whether to print information about the execution :return: str: message about the execution

Type Default Details
save_notebook bool False Saves the output of cells in the notebook if True (default: False)
kernel Literal[‘:current’, ‘:target’, ‘:any_available’] | str :target kernel name or :current to use current kernel, :target to use kernel specified in metadata of target notebook, :any_available to use any available kernel.
kernels_on_fail list | str None kernels to try if kernel does not exist / is not available (default: [“:current”, “python”, “:any_available”])
verbose bool True
kwargs
Returns str