tethys.core.nodes.operators.bash.operator_bash_per_packet

Module Contents

tethys.core.nodes.operators.bash.operator_bash_per_packet.log[source]
class tethys.core.nodes.operators.bash.operator_bash_per_packet.BashPerPacketOperator(cmd: Union[Callable, str], env: Optional[Dict[str, str]] = None, preload_env: bool = False, return_stdout: bool = False)[source]

Bases: tethys.core.nodes.operators.operator_base.OperatorBase

This operator executes bash command for each data_packet.

Parameters
  • cmd (Union[Callable, str]) – command as a string or a function that generates command. Function should except 2 args: fn(data_packet, stream)

  • env (dict of the environments variables (default: None)) – Optional[Dict[str, str]]

  • preload_env (bool) – load env variables from the os.environ (default: False)

  • return_stdout (bool) – send stdout to the next nodes (default: False)

property env(self) → dict[source]
cmd(self, data_packet: Any, stream: ZeroStream)[source]
process(self, data_packet: Any, stream: ZeroStream, **kwargs)[source]

Execute bash command.

Parameters
  • data_packet – any data object

  • stream (StreamBase) – Any stream

Returns

None