Treasure Workflow supports the Python operator to run custom scripts, which are triggered by other command operators in Treasure Workflow.
The py> operator runs a Python script using Python command.
See Python API documents for details including variable mappings to keyword arguments.
+step1:
py>: my_step1_method
+step2:
py>: tasks.MyWorkflow.step2py>: [tasks.][PACKAGE.CLASS.]METHODwhere:
[tasks.] -
[PACKAGE.CLASS] - Optional class name of your Python object.
METHOD: Name of the task defined within your Python object class that defines the action that you want performed during this stage of the Treasure Workflow.
py>: tasks.MyWorkflow.my_taskpython : PATH STRING or COMMAND ARGUMENTS LIST
The python defaults to python . If an alternate python and options are desired, use the python option.Examples:
- python: /opt/conda/bin/python
- python: ["python" , "v"]
It is also possible to configure this in an export section.
Example:
_export:
py:
python: /opt/conda/bin/python