186 lines
13 KiB
HTML
186 lines
13 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
|
|||
|
<html lang="en" data-content_root="./">
|
|||
|
<head>
|
|||
|
<meta charset="utf-8" />
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|||
|
|
|||
|
<title>Welcome to pynodes’s documentation! — pynodes 0.1 documentation</title>
|
|||
|
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d1102ebc" />
|
|||
|
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=12dfc556" />
|
|||
|
<script src="_static/documentation_options.js?v=2709fde1"></script>
|
|||
|
<script src="_static/doctools.js?v=888ff710"></script>
|
|||
|
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
|||
|
<link rel="index" title="Index" href="genindex.html" />
|
|||
|
<link rel="search" title="Search" href="search.html" />
|
|||
|
|
|||
|
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head><body>
|
|||
|
|
|||
|
|
|||
|
<div class="document">
|
|||
|
<div class="documentwrapper">
|
|||
|
<div class="bodywrapper">
|
|||
|
|
|||
|
|
|||
|
<div class="body" role="main">
|
|||
|
|
|||
|
<section id="welcome-to-pynodes-s-documentation">
|
|||
|
<h1>Welcome to pynodes’s documentation!<a class="headerlink" href="#welcome-to-pynodes-s-documentation" title="Link to this heading">¶</a></h1>
|
|||
|
<p><strong>pynodes</strong> is a Python library to manage Nodes classes.
|
|||
|
A node is an object which is related to other nodes given a tree chart.</p>
|
|||
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp gp-VirtualEnv">(venv)</span> <span class="gp">$ </span>pip<span class="w"> </span>install<span class="w"> </span>pynodes
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
<div class="toctree-wrapper compound">
|
|||
|
</div>
|
|||
|
</section>
|
|||
|
<section id="basic-usage">
|
|||
|
<h1>Basic Usage<a class="headerlink" href="#basic-usage" title="Link to this heading">¶</a></h1>
|
|||
|
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pynodes</span>
|
|||
|
<span class="n">node</span> <span class="o">=</span> <span class="n">pynodes</span><span class="o">.</span><span class="n">Node</span><span class="p">()</span>
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
<dl class="py class">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node">
|
|||
|
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pynodes.</span></span><span class="sig-name descname"><span class="pre">Node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#pynodes.Node" title="pynodes.Node"><span class="pre">Node</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pynodes.html#Node"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pynodes.Node" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>Should be subclassed only</p>
|
|||
|
<dl class="py method">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.add_child">
|
|||
|
<span class="sig-name descname"><span class="pre">add_child</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">child</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#pynodes.Node" title="pynodes.Node"><span class="pre">Node</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/pynodes.html#Node.add_child"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pynodes.Node.add_child" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>add new child node to current instance</p>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
<dl class="py method">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.check_lineage">
|
|||
|
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">check_lineage</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nodes</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="#pynodes.Node" title="pynodes.Node"><span class="pre">Node</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference internal" href="_modules/pynodes.html#Node.check_lineage"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pynodes.Node.check_lineage" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><dl class="simple">
|
|||
|
<dt>check if the list of nodes is a straight lineage:</dt><dd><p>node 1 (ancestor) -> node 2 -> node 3 -> … -> node n (grand
|
|||
|
children)</p>
|
|||
|
</dd>
|
|||
|
</dl>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
<dl class="py method">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.create_random_nodes">
|
|||
|
<em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">create_random_nodes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">type_</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'cmd'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">depth</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#pynodes.Node" title="pynodes.Node"><span class="pre">Node</span></a></span></span><a class="reference internal" href="_modules/pynodes.html#Node.create_random_nodes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pynodes.Node.create_random_nodes" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>Creates random tree of nodes for testing purpose</p>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
<dl class="py property">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.level">
|
|||
|
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">level</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">int</span></em><a class="headerlink" href="#pynodes.Node.level" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>returns the level of the Node object</p>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
<dl class="py property">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.parents">
|
|||
|
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">parents</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">list</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="#pynodes.Node" title="pynodes.Node"><span class="pre">Node</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#pynodes.Node.parents" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>returns all the ancestors of the Node object</p>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
<dl class="py property">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.path">
|
|||
|
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">path</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">str</span></em><a class="headerlink" href="#pynodes.Node.path" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>returns a representation of the ancestor lineage of self</p>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
<dl class="py method">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.pretty_print">
|
|||
|
<span class="sig-name descname"><span class="pre">pretty_print</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/pynodes.html#Node.pretty_print"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pynodes.Node.pretty_print" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>print children tree from current instance</p>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
<dl class="py method">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.reset_stats">
|
|||
|
<em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">reset_stats</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/pynodes.html#Node.reset_stats"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pynodes.Node.reset_stats" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>reset all the ClassVar members</p>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
<dl class="py property">
|
|||
|
<dt class="sig sig-object py" id="pynodes.Node.siblings">
|
|||
|
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">siblings</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">list</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="#pynodes.Node" title="pynodes.Node"><span class="pre">Node</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#pynodes.Node.siblings" title="Link to this definition">¶</a></dt>
|
|||
|
<dd><p>returns all the siblings of the Node object</p>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
</section>
|
|||
|
<section id="indices-and-tables">
|
|||
|
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Link to this heading">¶</a></h1>
|
|||
|
<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>
|
|||
|
</section>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
|||
|
<div class="sphinxsidebarwrapper">
|
|||
|
<h1 class="logo"><a href="#">pynodes</a></h1>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<h3>Navigation</h3>
|
|||
|
|
|||
|
<div class="relations">
|
|||
|
<h3>Related Topics</h3>
|
|||
|
<ul>
|
|||
|
<li><a href="#">Documentation overview</a><ul>
|
|||
|
</ul></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<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" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
|||
|
<input type="submit" value="Go" />
|
|||
|
</form>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<script>document.getElementById('searchbox').style.display = "block"</script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="clearer"></div>
|
|||
|
</div>
|
|||
|
<div class="footer">
|
|||
|
©2024, fabthegreat.
|
|||
|
|
|||
|
|
|
|||
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.2.6</a>
|
|||
|
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
|
|||
|
|
|||
|
|
|
|||
|
<a href="_sources/index.rst.txt"
|
|||
|
rel="nofollow">Page source</a>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|