jacquev6 / ActionTree

Python library executing long concurrent actions with inter-dependencies

Home Page:http://jacquev6.github.io/ActionTree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ActionTree is a Python (3.5+) library to execute (long) actions in parallel, respecting dependencies between those actions. You create a dependency graph of actions to be executed and then call the execute function on its root.

It's licensed under the MIT license. It's available on the Python package index. Its documentation and its source code are on GitHub.

Questions? Remarks? Bugs? Want to contribute? Open an issue!

https://img.shields.io/github/workflow/status/jacquev6/ActionTree/Continuous%20Integration?label=CI&logo=github PyPI PyPI

Quick start

Install from PyPI:

$ pip install ActionTree

With dependencies to create Gantt charts and dependency graphs:

$ pip install 'ActionTree[dependency_graphs,gantt]'

Import:

>>> from ActionTree import execute
>>> from ActionTree.stock import CallSubprocess

Execute some action:

>>> link = CallSubprocess(["g++", "a.o", "b.o", "-o", "test"])
>>> link.add_dependency(CallSubprocess(["g++", "-c", "a.cpp", "-o", "a.o"]))
>>> link.add_dependency(CallSubprocess(["g++", "-c", "b.cpp", "-o", "b.o"]))
>>> report = execute(link)

And verify everything went well:

>>> report.is_success
True
>>> os.path.isfile("test")
True

About

Python library executing long concurrent actions with inter-dependencies

http://jacquev6.github.io/ActionTree

License:MIT License


Languages

Language:Python 96.2%Language:Shell 2.8%Language:Dockerfile 0.9%