Powerful but simple orchestration framework for python.
You find the latest documentation on readthedocs.io: https://xyzflow.readthedocs.io/en/latest/.
pip install xyzflow
You can write a flow in a few lines of code:
from xyzflow import Parameter
# Define parameters
x = Parameter(value=10, description="X")
y = Parameter(value=10, description="Y")
def main():
return x + y
if __name__ == "__main__":
print(main()()) # Execute flow and print the result
A flow consists out of:
- Parameter definitions in the global scope
- A
main()
method that returns the resulting Task - Optionally: A main if clause that executes your defined flow
Everything is a Task
(even Parameters). Inside of the main()
you define a flow.
A flow is a sequence of tasks that shall be executed. You can give the results of a task as input parameter to another task.
That way, we create an execution graph.
Any task can be evaluted at any time with the ()
operator.
The result can be used to continue with a flow or just to get the final result of a flow.