Control, Create, Run named workflows & tasks with before/after middlewares support, data persistence, orm, authentication, logging, multi-threading/processing, events, network sockets, webhooks, client-agent libraries, etc with plugins support [Actively Developed, Funding Invited] - pip3 install taskcontrol https://pypi.org/project/taskcontrol
MIT License
taskcontrol (py-taskcontrol)
is a python library to create tasks in and based on named taskflow controls. It allows middlewares before and after each task with support for concurrent processing. taskcontrol can run single or multiple tasks during task invocation/runs.task
that takes arguments to set up the named taskflow controls. It also provides methods to create a plugin and allow working with tasks as a module and/or pre-created ordered task list. Taskcontrol allows for scaling of plugin development with various utilities like authentication, logging, concurrency, sockets, events, publisher-subscriber architectures, webhooks, client-server http api servers etc.[Actively Developed, Funding Invited]
Python
pip3 install taskcontrol
In Development Version: 1.3.0b2 (functional - production ready with plugin and concurrency support, with demos)
Current Version: 1.3.0b1 (functional - production ready with plugin and concurrency support, with demos)
Previous Version: 1.3.0b0 (functional - production ready with most planned features with MVP, with demos)
Previous Version: 1.2.5 (functional - production ready with most planned features with MVP, with demos)
Previous Version: 1.1.2 (functional - production ready minor issues)
Previous Version: 1.1.0/1.1.1 (functional - not production ready - minor bug. Please upgrade to v1.1.2)
Releases Lists in short the releases of the package
https://github.com/taskcontrols/py-taskcontrol
https://pypi.org/project/taskcontrol
https://taskcontrols.github.io/
General demo example - main_workflow.py
from taskcontrol import Workflow, task
sparrow = Workflow()
@task(
name="migrate",
task_instance=sparrow
)
def fly(ctx, result, *args, **kwargs):
print("Running my task function: fly", args, kwargs)
return args, kwargs
result = sparrow.start()
print(result)
Though it may support Python version 2.x. However, it has not been tested in 2.x. The Syntax and Features of the library supports Python version 2.x. Use at your own risk.
Describes in short the usage of the package
Documentation for taskcontrols
You can also create a simple workflow without taskcontrol using a simple list or nested list and loop through them using a for/while loop and invoke them during looping
# Loop the lists below and invoke the functions
lst = ["f1", "f2", "f3"]
nest_lst = [["f1", "f2"], "f3", "f4", ["f5"]]
# Use a reducer if you want to send args to next function like below
def test(a,b):
print(a,b)
return {"a":a, "b":b}
def tester(a,b):
print(a,b)
return None
kwargs_for_first_function_the_its_returns_or_other_value_for_next_func = {"a":"a", "b":"b"}
ls = [kwargs_for_first_function_the_its_returns_or_other_value_for_next_func, test, tester]
import functools
def red(kwargs_for_first_then_func, p):
i = p(kwargs.get("a"), kwargs.get("b"))
return i
functools.reduce(red, ls)
The MIT License (MIT) - See LICENSE for further details
Copyright © 2020 - till library works