495 lines
No EOL
36 KiB
HTML
495 lines
No EOL
36 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>accounting package — Accounting API 0.1-beta documentation</title>
|
|
|
|
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
|
|
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: '../',
|
|
VERSION: '0.1-beta',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="../_static/jquery.js"></script>
|
|
<script type="text/javascript" src="../_static/underscore.js"></script>
|
|
<script type="text/javascript" src="../_static/doctools.js"></script>
|
|
<link rel="top" title="Accounting API 0.1-beta documentation" href="../index.html" />
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="../py-modindex.html" title="Python Module Index"
|
|
>modules</a> |</li>
|
|
<li class="right" >
|
|
<a href="../http-routingtable.html" title="HTTP Routing Table"
|
|
>routing table</a> |</li>
|
|
<li><a href="../index.html">Accounting API 0.1-beta documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="accounting-package">
|
|
<h1>accounting package<a class="headerlink" href="#accounting-package" title="Permalink to this headline">¶</a></h1>
|
|
<div class="section" id="subpackages">
|
|
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2>
|
|
<div class="toctree-wrapper compound">
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="accounting.storage.html">accounting.storage package</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="accounting.storage.html#subpackages">Subpackages</a><ul>
|
|
<li class="toctree-l3"><a class="reference internal" href="accounting.storage.sql.html">accounting.storage.sql package</a><ul>
|
|
<li class="toctree-l4"><a class="reference internal" href="accounting.storage.sql.html#submodules">Submodules</a></li>
|
|
<li class="toctree-l4"><a class="reference internal" href="accounting.storage.sql.html#module-accounting.storage.sql.models">accounting.storage.sql.models module</a></li>
|
|
<li class="toctree-l4"><a class="reference internal" href="accounting.storage.sql.html#module-accounting.storage.sql">Module contents</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l2"><a class="reference internal" href="accounting.storage.html#submodules">Submodules</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="accounting.storage.html#module-accounting.storage.ledgercli">accounting.storage.ledgercli module</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="accounting.storage.html#module-accounting.storage">Module contents</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="submodules">
|
|
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
|
|
</div>
|
|
<div class="section" id="module-accounting.client">
|
|
<span id="accounting-client-module"></span><h2>accounting.client module<a class="headerlink" href="#module-accounting.client" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="class">
|
|
<dt id="accounting.client.Client">
|
|
<em class="property">class </em><tt class="descclassname">accounting.client.</tt><tt class="descname">Client</tt><big>(</big><em>host=None</em>, <em>json_encoder=None</em>, <em>json_decoder=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#Client"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.Client" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.object</span></tt></p>
|
|
<dl class="method">
|
|
<dt id="accounting.client.Client.get">
|
|
<tt class="descname">get</tt><big>(</big><em>path</em><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#Client.get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.Client.get" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.client.Client.get_balance">
|
|
<tt class="descname">get_balance</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#Client.get_balance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.Client.get_balance" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.client.Client.get_register">
|
|
<tt class="descname">get_register</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#Client.get_register"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.Client.get_register" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.client.Client.post">
|
|
<tt class="descname">post</tt><big>(</big><em>path</em>, <em>payload</em>, <em>**kw</em><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#Client.post"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.Client.post" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.client.Client.simple_transaction">
|
|
<tt class="descname">simple_transaction</tt><big>(</big><em>from_acc</em>, <em>to_acc</em>, <em>amount</em>, <em>symbol=None</em>, <em>payee=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#Client.simple_transaction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.Client.simple_transaction" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.client.main">
|
|
<tt class="descclassname">accounting.client.</tt><tt class="descname">main</tt><big>(</big><em>argv=None</em>, <em>prog=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#main"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.main" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.client.print_balance_accounts">
|
|
<tt class="descclassname">accounting.client.</tt><tt class="descname">print_balance_accounts</tt><big>(</big><em>accounts</em>, <em>level=0</em><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#print_balance_accounts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.print_balance_accounts" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.client.print_transactions">
|
|
<tt class="descclassname">accounting.client.</tt><tt class="descname">print_transactions</tt><big>(</big><em>transactions</em><big>)</big><a class="reference internal" href="../_modules/accounting/client.html#print_transactions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.client.print_transactions" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="module-accounting.config">
|
|
<span id="accounting-config-module"></span><h2>accounting.config module<a class="headerlink" href="#module-accounting.config" title="Permalink to this headline">¶</a></h2>
|
|
</div>
|
|
<div class="section" id="module-accounting.decorators">
|
|
<span id="accounting-decorators-module"></span><h2>accounting.decorators module<a class="headerlink" href="#module-accounting.decorators" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="function">
|
|
<dt id="accounting.decorators.allow_all_origins">
|
|
<tt class="descclassname">accounting.decorators.</tt><tt class="descname">allow_all_origins</tt><big>(</big><em>origin</em><big>)</big><a class="reference internal" href="../_modules/accounting/decorators.html#allow_all_origins"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.decorators.allow_all_origins" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.decorators.cors">
|
|
<tt class="descclassname">accounting.decorators.</tt><tt class="descname">cors</tt><big>(</big><em>origin_callback=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/decorators.html#cors"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.decorators.cors" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Flask endpoint decorator.</p>
|
|
<p>Example:</p>
|
|
<div class="highlight-python"><div class="highlight"><pre><span class="nd">@app.route</span><span class="p">(</span><span class="s">'/cors-endpoint'</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s">'GET'</span><span class="p">,</span> <span class="s">'OPTIONS'</span><span class="p">])</span>
|
|
<span class="nd">@cors</span><span class="p">()</span>
|
|
<span class="k">def</span> <span class="nf">cors_endpoint</span><span class="p">():</span>
|
|
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">message</span><span class="o">=</span><span class="s">'This is accessible via a cross-origin XHR'</span><span class="p">)</span>
|
|
|
|
<span class="c"># Or if you want to control the domains this resource can be requested</span>
|
|
<span class="c"># from via CORS:</span>
|
|
<span class="n">domains</span> <span class="o">=</span> <span class="p">[</span><span class="s">'http://wandborg.se'</span><span class="p">,</span> <span class="s">'http://sfconservancy.org'</span><span class="p">]</span>
|
|
|
|
<span class="k">def</span> <span class="nf">restrict_domains</span><span class="p">(</span><span class="n">origin</span><span class="p">):</span>
|
|
<span class="k">return</span> <span class="s">' '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">domains</span><span class="p">)</span>
|
|
|
|
<span class="nd">@app.route</span><span class="p">(</span><span class="s">'/restricted-cors-endpoint'</span><span class="p">)</span>
|
|
<span class="nd">@cors</span><span class="p">(</span><span class="n">restrict_domains</span><span class="p">)</span>
|
|
<span class="k">def</span> <span class="nf">restricted_cors_endpoint</span><span class="p">():</span>
|
|
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span>
|
|
<span class="n">message</span><span class="o">=</span><span class="s">'This is accessible from </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="s">', '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">domains</span><span class="p">))</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>origin_callback</strong> (<em>function</em>) – A callback that takes one str() argument
|
|
containing the <tt class="docutils literal"><span class="pre">Origin</span></tt> HTTP header from the <tt class="xref py py-data docutils literal"><span class="pre">request</span></tt> object.
|
|
This can be used to filter out which domains the resource can be
|
|
requested via CORS from.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.decorators.jsonify_exceptions">
|
|
<tt class="descclassname">accounting.decorators.</tt><tt class="descname">jsonify_exceptions</tt><big>(</big><em>func</em><big>)</big><a class="reference internal" href="../_modules/accounting/decorators.html#jsonify_exceptions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.decorators.jsonify_exceptions" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Wraps a Flask endpoint and catches any AccountingException-based
|
|
exceptions which are returned to the client as JSON.</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="module-accounting.exceptions">
|
|
<span id="accounting-exceptions-module"></span><h2>accounting.exceptions module<a class="headerlink" href="#module-accounting.exceptions" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="exception">
|
|
<dt id="accounting.exceptions.AccountingException">
|
|
<em class="property">exception </em><tt class="descclassname">accounting.exceptions.</tt><tt class="descname">AccountingException</tt><big>(</big><em>message</em>, <em>**kw</em><big>)</big><a class="reference internal" href="../_modules/accounting/exceptions.html#AccountingException"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.exceptions.AccountingException" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.Exception</span></tt></p>
|
|
<p>Used as a base for exceptions that are returned to the caller via the
|
|
jsonify_exceptions decorator</p>
|
|
</dd></dl>
|
|
|
|
<dl class="exception">
|
|
<dt id="accounting.exceptions.LedgerNotBalanced">
|
|
<em class="property">exception </em><tt class="descclassname">accounting.exceptions.</tt><tt class="descname">LedgerNotBalanced</tt><big>(</big><em>message</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#accounting.exceptions.LedgerNotBalanced" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#accounting.exceptions.AccountingException" title="accounting.exceptions.AccountingException"><tt class="xref py py-class docutils literal"><span class="pre">accounting.exceptions.AccountingException</span></tt></a></p>
|
|
</dd></dl>
|
|
|
|
<dl class="exception">
|
|
<dt id="accounting.exceptions.TransactionIDCollision">
|
|
<em class="property">exception </em><tt class="descclassname">accounting.exceptions.</tt><tt class="descname">TransactionIDCollision</tt><big>(</big><em>message</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#accounting.exceptions.TransactionIDCollision" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#accounting.exceptions.AccountingException" title="accounting.exceptions.AccountingException"><tt class="xref py py-class docutils literal"><span class="pre">accounting.exceptions.AccountingException</span></tt></a></p>
|
|
</dd></dl>
|
|
|
|
<dl class="exception">
|
|
<dt id="accounting.exceptions.TransactionNotFound">
|
|
<em class="property">exception </em><tt class="descclassname">accounting.exceptions.</tt><tt class="descname">TransactionNotFound</tt><big>(</big><em>message</em>, <em>**kw</em><big>)</big><a class="reference internal" href="../_modules/accounting/exceptions.html#TransactionNotFound"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.exceptions.TransactionNotFound" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference internal" href="#accounting.exceptions.AccountingException" title="accounting.exceptions.AccountingException"><tt class="xref py py-class docutils literal"><span class="pre">accounting.exceptions.AccountingException</span></tt></a></p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="module-accounting.gtkclient">
|
|
<span id="accounting-gtkclient-module"></span><h2>accounting.gtkclient module<a class="headerlink" href="#module-accounting.gtkclient" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="class">
|
|
<dt id="accounting.gtkclient.AccountingApplication">
|
|
<em class="property">class </em><tt class="descclassname">accounting.gtkclient.</tt><tt class="descname">AccountingApplication</tt><a class="reference internal" href="../_modules/accounting/gtkclient.html#AccountingApplication"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.AccountingApplication" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.object</span></tt></p>
|
|
<dl class="method">
|
|
<dt id="accounting.gtkclient.AccountingApplication.load_ui">
|
|
<tt class="descname">load_ui</tt><big>(</big><em>path</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#AccountingApplication.load_ui"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.AccountingApplication.load_ui" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.gtkclient.AccountingApplication.on_about_dialog_response">
|
|
<tt class="descname">on_about_dialog_response</tt><big>(</big><em>widget</em>, <em>response_type</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#AccountingApplication.on_about_dialog_response"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.AccountingApplication.on_about_dialog_response" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.gtkclient.AccountingApplication.on_show_about_activate">
|
|
<tt class="descname">on_show_about_activate</tt><big>(</big><em>widget</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#AccountingApplication.on_show_about_activate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.AccountingApplication.on_show_about_activate" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.gtkclient.AccountingApplication.on_transaction_refresh_activate">
|
|
<tt class="descname">on_transaction_refresh_activate</tt><big>(</big><em>widget</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#AccountingApplication.on_transaction_refresh_activate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.AccountingApplication.on_transaction_refresh_activate" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.gtkclient.AccountingApplication.on_transaction_view_cursor_changed">
|
|
<tt class="descname">on_transaction_view_cursor_changed</tt><big>(</big><em>widget</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#AccountingApplication.on_transaction_view_cursor_changed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.AccountingApplication.on_transaction_view_cursor_changed" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="accounting.gtkclient.AccountingApplication.on_transactions_loaded">
|
|
<tt class="descname">on_transactions_loaded</tt><big>(</big><em>transactions</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#AccountingApplication.on_transactions_loaded"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.AccountingApplication.on_transactions_loaded" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.gtkclient.indicate_activity">
|
|
<tt class="descclassname">accounting.gtkclient.</tt><tt class="descname">indicate_activity</tt><big>(</big><em>func_or_str</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#indicate_activity"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.indicate_activity" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.gtkclient.indicate_activity_done">
|
|
<tt class="descclassname">accounting.gtkclient.</tt><tt class="descname">indicate_activity_done</tt><big>(</big><em>func</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#indicate_activity_done"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.indicate_activity_done" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.gtkclient.main">
|
|
<tt class="descclassname">accounting.gtkclient.</tt><tt class="descname">main</tt><big>(</big><em>argv=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#main"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.main" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="module-accounting.models">
|
|
<span id="accounting-models-module"></span><h2>accounting.models module<a class="headerlink" href="#module-accounting.models" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="class">
|
|
<dt id="accounting.models.Account">
|
|
<em class="property">class </em><tt class="descclassname">accounting.models.</tt><tt class="descname">Account</tt><big>(</big><em>name=None</em>, <em>amounts=None</em>, <em>accounts=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/models.html#Account"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.models.Account" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.object</span></tt></p>
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="accounting.models.Amount">
|
|
<em class="property">class </em><tt class="descclassname">accounting.models.</tt><tt class="descname">Amount</tt><big>(</big><em>amount=None</em>, <em>symbol=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/models.html#Amount"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.models.Amount" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.object</span></tt></p>
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="accounting.models.Posting">
|
|
<em class="property">class </em><tt class="descclassname">accounting.models.</tt><tt class="descname">Posting</tt><big>(</big><em>account=None</em>, <em>amount=None</em>, <em>metadata=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/models.html#Posting"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.models.Posting" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.object</span></tt></p>
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="accounting.models.Transaction">
|
|
<em class="property">class </em><tt class="descclassname">accounting.models.</tt><tt class="descname">Transaction</tt><big>(</big><em>id=None</em>, <em>date=None</em>, <em>payee=None</em>, <em>postings=None</em>, <em>metadata=None</em>, <em>_generate_id=False</em><big>)</big><a class="reference internal" href="../_modules/accounting/models.html#Transaction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.models.Transaction" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">builtins.object</span></tt></p>
|
|
<dl class="method">
|
|
<dt id="accounting.models.Transaction.generate_id">
|
|
<tt class="descname">generate_id</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/models.html#Transaction.generate_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.models.Transaction.generate_id" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="module-accounting.transport">
|
|
<span id="accounting-transport-module"></span><h2>accounting.transport module<a class="headerlink" href="#module-accounting.transport" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="class">
|
|
<dt id="accounting.transport.AccountingDecoder">
|
|
<em class="property">class </em><tt class="descclassname">accounting.transport.</tt><tt class="descname">AccountingDecoder</tt><a class="reference internal" href="../_modules/accounting/transport.html#AccountingDecoder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.transport.AccountingDecoder" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="http://flask.pocoo.org/docs/api/#flask.json.JSONDecoder" title="(in Flask v0.10)"><tt class="xref py py-class docutils literal"><span class="pre">flask.json.JSONDecoder</span></tt></a></p>
|
|
<dl class="method">
|
|
<dt id="accounting.transport.AccountingDecoder.dict_to_object">
|
|
<tt class="descname">dict_to_object</tt><big>(</big><em>d</em><big>)</big><a class="reference internal" href="../_modules/accounting/transport.html#AccountingDecoder.dict_to_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.transport.AccountingDecoder.dict_to_object" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="class">
|
|
<dt id="accounting.transport.AccountingEncoder">
|
|
<em class="property">class </em><tt class="descclassname">accounting.transport.</tt><tt class="descname">AccountingEncoder</tt><big>(</big><em>skipkeys=False</em>, <em>ensure_ascii=True</em>, <em>check_circular=True</em>, <em>allow_nan=True</em>, <em>sort_keys=False</em>, <em>indent=None</em>, <em>separators=None</em>, <em>default=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/transport.html#AccountingEncoder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.transport.AccountingEncoder" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Bases: <a class="reference external" href="http://flask.pocoo.org/docs/api/#flask.json.JSONEncoder" title="(in Flask v0.10)"><tt class="xref py py-class docutils literal"><span class="pre">flask.json.JSONEncoder</span></tt></a></p>
|
|
<dl class="method">
|
|
<dt id="accounting.transport.AccountingEncoder.default">
|
|
<tt class="descname">default</tt><big>(</big><em>o</em><big>)</big><a class="reference internal" href="../_modules/accounting/transport.html#AccountingEncoder.default"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.transport.AccountingEncoder.default" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="module-accounting.web">
|
|
<span id="accounting-web-module"></span><h2>accounting.web module<a class="headerlink" href="#module-accounting.web" title="Permalink to this headline">¶</a></h2>
|
|
<p>This module contains the high-level webservice logic such as the Flask setup
|
|
and the Flask endpoints.</p>
|
|
<dl class="function">
|
|
<dt id="accounting.web.client">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">client</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#client"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.client" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.index">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">index</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#index"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.index" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Hello World!</p>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.init_ledger">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">init_ledger</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#init_ledger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.init_ledger" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.main">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">main</tt><big>(</big><em>argv=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#main"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.main" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.transaction_by_id_options">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">transaction_by_id_options</tt><big>(</big><em>transaction_id=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#transaction_by_id_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.transaction_by_id_options" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.transaction_delete">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">transaction_delete</tt><big>(</big><em>transaction_id=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#transaction_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.transaction_delete" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.transaction_get">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">transaction_get</tt><big>(</big><em>transaction_id=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#transaction_get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.transaction_get" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.transaction_get_all">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">transaction_get_all</tt><big>(</big><em>transaction_id=None</em><big>)</big><a class="headerlink" href="#accounting.web.transaction_get_all" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns the JSON-serialized output of <tt class="xref py py-meth docutils literal"><span class="pre">accounting.Ledger.reg()</span></tt></p>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.transaction_options">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">transaction_options</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#transaction_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.transaction_options" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.transaction_post">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">transaction_post</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#transaction_post"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.transaction_post" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>REST/JSON endpoint for transactions.</p>
|
|
<p>Current state:</p>
|
|
<p>Takes a POST request with a <tt class="docutils literal"><span class="pre">transactions</span></tt> JSON payload and writes it to
|
|
the ledger file.</p>
|
|
<p>Requires the <tt class="docutils literal"><span class="pre">transactions</span></tt> payload to be __type__-annotated:</p>
|
|
<div class="highlight-json"><pre>{
|
|
"transactions": [
|
|
{
|
|
"__type__": "Transaction",
|
|
"date": "2013-01-01",
|
|
"payee": "Kindly T. Donor",
|
|
"postings": [
|
|
{
|
|
"__type__": "Posting",
|
|
"account": "Income:Foo:Donation",
|
|
"amount": {
|
|
"__type__": "Amount",
|
|
"amount": "-100",
|
|
"symbol": "$"
|
|
}
|
|
},
|
|
{
|
|
"__type__": "Posting",
|
|
"account": "Assets:Checking",
|
|
"amount": {
|
|
"__type__": "Amount",
|
|
"amount": "100",
|
|
"symbol": "$"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<p>becomes:</p>
|
|
<div class="highlight-python"><pre>2013-01-01 Kindly T. Donor
|
|
Income:Foo:Donation $ -100
|
|
Assets:Checking $ 100</pre>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="function">
|
|
<dt id="accounting.web.transaction_update">
|
|
<tt class="descclassname">accounting.web.</tt><tt class="descname">transaction_update</tt><big>(</big><em>transaction_id=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/web.html#transaction_update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.web.transaction_update" title="Permalink to this definition">¶</a></dt>
|
|
<dd></dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="module-accounting">
|
|
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-accounting" title="Permalink to this headline">¶</a></h2>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<p class="logo"><a href="../index.html">
|
|
<img class="logo" src="../_static/accounting-api-logo.png" alt="Logo"/>
|
|
</a></p>
|
|
<h3><a href="../index.html">Table Of Contents</a></h3>
|
|
<ul>
|
|
<li><a class="reference internal" href="#">accounting package</a><ul>
|
|
<li><a class="reference internal" href="#subpackages">Subpackages</a><ul>
|
|
</ul>
|
|
</li>
|
|
<li><a class="reference internal" href="#submodules">Submodules</a></li>
|
|
<li><a class="reference internal" href="#module-accounting.client">accounting.client module</a></li>
|
|
<li><a class="reference internal" href="#module-accounting.config">accounting.config module</a></li>
|
|
<li><a class="reference internal" href="#module-accounting.decorators">accounting.decorators module</a></li>
|
|
<li><a class="reference internal" href="#module-accounting.exceptions">accounting.exceptions module</a></li>
|
|
<li><a class="reference internal" href="#module-accounting.gtkclient">accounting.gtkclient module</a></li>
|
|
<li><a class="reference internal" href="#module-accounting.models">accounting.models module</a></li>
|
|
<li><a class="reference internal" href="#module-accounting.transport">accounting.transport module</a></li>
|
|
<li><a class="reference internal" href="#module-accounting.web">accounting.web module</a></li>
|
|
<li><a class="reference internal" href="#module-accounting">Module contents</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h3>Related Topics</h3>
|
|
<ul>
|
|
<li><a href="../index.html">Documentation overview</a><ul>
|
|
</ul></li>
|
|
</ul>
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="../_sources/api/accounting.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
<div id="searchbox" style="display: none">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="../search.html" method="get">
|
|
<input type="text" name="q" />
|
|
<input type="submit" value="Go" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
<p class="searchtip" style="font-size: 90%">
|
|
Enter search terms or a module, class or function name.
|
|
</p>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2013, Joar Wandborg.
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
|
|
</div>
|
|
|
|
</body>
|
|
</html> |