docs/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ActionTree — ActionTree 0.13.2 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="User guide" href="user_guide.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="actiontree">
<h1>ActionTree<a class="headerlink" href="#actiontree" title="Permalink to this headline">¶</a></h1>
<p><em>ActionTree</em> 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 <code class="docutils literal notranslate"><span class="pre">execute</span></code> function on its root.</p>
<p>It’s licensed under the <a class="reference external" href="http://choosealicense.com/licenses/mit/">MIT license</a>.
It’s available on the <a class="reference external" href="http://pypi.python.org/pypi/ActionTree">Python package index</a>.
Its <a class="reference external" href="http://jacquev6.github.io/ActionTree">documentation</a>
and its <a class="reference external" href="https://github.com/jacquev6/ActionTree">source code</a> are on GitHub.</p>
<p>Questions? Remarks? Bugs? Want to contribute? <a class="reference external" href="https://github.com/jacquev6/ActionTree/issues">Open an issue</a>!</p>
<a class="reference external image-reference" href="https://github.com/jacquev6/ActionTree/actions?query=workflow%3A%22Continuous+Integration%22"><img alt="https://img.shields.io/github/workflow/status/jacquev6/ActionTree/Continuous%20Integration?label=CI&logo=github" src="https://img.shields.io/github/workflow/status/jacquev6/ActionTree/Continuous%20Integration?label=CI&logo=github" /></a>
<a class="reference external image-reference" href="https://pypi.org/project/ActionTree/"><img alt="PyPI" src="https://img.shields.io/pypi/v/ActionTree?logo=pypi" /></a>
<a class="reference external image-reference" href="https://pypi.org/project/ActionTree/"><img alt="PyPI" src="https://img.shields.io/pypi/pyversions/ActionTree?logo=pypi" /></a>
<div class="section" id="quick-start">
<h2>Quick start<a class="headerlink" href="#quick-start" title="Permalink to this headline">¶</a></h2>
<p>Install from PyPI:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ pip install ActionTree
</pre></div>
</div>
<p>With dependencies to create Gantt charts and dependency graphs:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ pip install 'ActionTree[dependency_graphs,gantt]'
</pre></div>
</div>
<p>Import:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ActionTree</span> <span class="kn">import</span> <span class="n">execute</span>
<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">ActionTree.stock</span> <span class="kn">import</span> <span class="n">CallSubprocess</span>
</pre></div>
</div>
<p>Execute some action:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">link</span> <span class="o">=</span> <span class="n">CallSubprocess</span><span class="p">([</span><span class="s2">"g++"</span><span class="p">,</span> <span class="s2">"a.o"</span><span class="p">,</span> <span class="s2">"b.o"</span><span class="p">,</span> <span class="s2">"-o"</span><span class="p">,</span> <span class="s2">"test"</span><span class="p">])</span>
<span class="gp">>>> </span><span class="n">link</span><span class="o">.</span><span class="n">add_dependency</span><span class="p">(</span><span class="n">CallSubprocess</span><span class="p">([</span><span class="s2">"g++"</span><span class="p">,</span> <span class="s2">"-c"</span><span class="p">,</span> <span class="s2">"a.cpp"</span><span class="p">,</span> <span class="s2">"-o"</span><span class="p">,</span> <span class="s2">"a.o"</span><span class="p">]))</span>
<span class="gp">>>> </span><span class="n">link</span><span class="o">.</span><span class="n">add_dependency</span><span class="p">(</span><span class="n">CallSubprocess</span><span class="p">([</span><span class="s2">"g++"</span><span class="p">,</span> <span class="s2">"-c"</span><span class="p">,</span> <span class="s2">"b.cpp"</span><span class="p">,</span> <span class="s2">"-o"</span><span class="p">,</span> <span class="s2">"b.o"</span><span class="p">]))</span>
<span class="gp">>>> </span><span class="n">report</span> <span class="o">=</span> <span class="n">execute</span><span class="p">(</span><span class="n">link</span><span class="p">)</span>
</pre></div>
</div>
<p>And verify everything went well:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">report</span><span class="o">.</span><span class="n">is_success</span>
<span class="go">True</span>
<span class="gp">>>> </span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
<span class="go">True</span>
</pre></div>
</div>
</div>
<div class="section" id="contents">
<h2>Contents<a class="headerlink" href="#contents" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="user_guide.html">User guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="user_guide/introduction.html">Introduction</a><ul>
<li class="toctree-l3"><a class="reference internal" href="user_guide/introduction.html#actions-and-dependencies">Actions and dependencies</a></li>
<li class="toctree-l3"><a class="reference internal" href="user_guide/introduction.html#preview">Preview</a></li>
<li class="toctree-l3"><a class="reference internal" href="user_guide/introduction.html#stock-actions">Stock actions</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="user_guide/drawings.html">Drawings</a><ul>
<li class="toctree-l3"><a class="reference internal" href="user_guide/drawings.html#gantt-chart">Gantt chart</a></li>
<li class="toctree-l3"><a class="reference internal" href="user_guide/drawings.html#dependency-graph">Dependency graph</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="user_guide/outputs.html">Outputs and side-effects</a><ul>
<li class="toctree-l3"><a class="reference internal" href="user_guide/outputs.html#return-values-exceptions-and-printed-output">Return values, exceptions and printed output</a></li>
<li class="toctree-l3"><a class="reference internal" href="user_guide/outputs.html#other-side-effects">Other side effects</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="user_guide/timing.html">Timing information</a></li>
<li class="toctree-l2"><a class="reference internal" href="user_guide/hooks.html">Hooks</a></li>
<li class="toctree-l2"><a class="reference internal" href="user_guide/resources.html">Resources</a><ul>
<li class="toctree-l3"><a class="reference internal" href="user_guide/resources.html#more-cpu-cores">More CPU cores</a></li>
<li class="toctree-l3"><a class="reference internal" href="user_guide/resources.html#arbitrary-resources">Arbitrary resources</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-ActionTree">Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-ActionTree.stock">Stock actions</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="indexes-and-tables">
<h2>Indexes and tables<a class="headerlink" href="#indexes-and-tables" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="#">
<img class="logo" src="_static/logo.png" alt="Logo"/>
</a></p>
<h1 class="logo"><a href="#">ActionTree</a></h1>
<p>
<iframe src="https://ghbtns.com/github-btn.html?user=jacquev6&repo=ActionTree&type=watch&count=true&size=large&v=2"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="user_guide.html">User guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2013-2018 <a href="http://vincent-jacques.net/">Vincent Jacques</a><script src="https://jacquev6.net/ribbon.2.js" data-project="ActionTree"></script>.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.4</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/index.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>