[doc] Updated and added precompiled html output

This commit is contained in:
Joar Wandborg 2013-12-26 13:20:07 +01:00
parent 281d6fed47
commit 0e72c2b543
29 changed files with 328 additions and 277 deletions

View file

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Accounting API &mdash; Accounting API 0.1-beta documentation</title>
<title>accounting-api README &mdash; 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" />
@ -24,8 +24,8 @@
<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" />
<link rel="next" title="REST API" href="restapi.html" />
<link rel="prev" title="Welcome to Accounting APIs documentation!" href="index.html" />
<link rel="next" title="REST API Documentation" href="restapi.html" />
<link rel="prev" title="Accounting API - Documentation" href="index.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
@ -48,10 +48,10 @@
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="restapi.html" title="REST API"
<a href="restapi.html" title="REST API Documentation"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to Accounting APIs documentation!"
<a href="index.html" title="Accounting API - Documentation"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Accounting API 0.1-beta documentation</a> &raquo;</li>
</ul>
@ -62,8 +62,8 @@
<div class="bodywrapper">
<div class="body">
<div class="section" id="the-accounting-api">
<h1>The Accounting API<a class="headerlink" href="#the-accounting-api" title="Permalink to this headline"></a></h1>
<div class="section" id="accounting-api-readme">
<h1>accounting-api README<a class="headerlink" href="#accounting-api-readme" title="Permalink to this headline"></a></h1>
<div class="section" id="dependencies">
<h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline"></a></h2>
<ul class="simple">
@ -149,7 +149,7 @@ sudo apt-get install ledger
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">The Accounting API</a><ul>
<li><a class="reference internal" href="#">accounting-api README</a><ul>
<li><a class="reference internal" href="#dependencies">Dependencies</a><ul>
<li><a class="reference internal" href="#gtk-client-dependencies">GTK Client Dependencies</a></li>
</ul>
@ -165,8 +165,8 @@ sudo apt-get install ledger
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">Welcome to Accounting API&#8217;s documentation!</a></li>
<li>Next: <a href="restapi.html" title="next chapter">REST API</a></li>
<li>Previous: <a href="index.html" title="previous chapter">Accounting API - Documentation</a></li>
<li>Next: <a href="restapi.html" title="next chapter">REST API Documentation</a></li>
</ul></li>
</ul>
<h3>This Page</h3>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
@ -66,6 +66,13 @@
<span class="sd"> Used as a base for exceptions that are returned to the caller via the</span>
<span class="sd"> jsonify_exceptions decorator</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">message</span> <span class="o">=</span> <span class="n">message</span>
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">kw</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="nb">setattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
</div>
<div class="viewcode-block" id="TransactionNotFound"><a class="viewcode-back" href="../../api/accounting.html#accounting.exceptions.TransactionNotFound">[docs]</a><span class="k">class</span> <span class="nc">TransactionNotFound</span><span class="p">(</span><span class="n">AccountingException</span><span class="p">):</span>
<span class="k">pass</span></div>
</pre></div>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
@ -60,14 +60,18 @@
<span class="c"># Part of accounting-api project:</span>
<span class="c"># https://gitorious.org/conservancy/accounting-api</span>
<span class="c"># License: AGPLv3-or-later</span>
<span class="kn">import</span> <span class="nn">datetime</span>
<span class="kn">import</span> <span class="nn">uuid</span>
<span class="kn">from</span> <span class="nn">decimal</span> <span class="kn">import</span> <span class="n">Decimal</span>
<div class="viewcode-block" id="Transaction"><a class="viewcode-back" href="../../api/accounting.html#accounting.models.Transaction">[docs]</a><span class="k">class</span> <span class="nc">Transaction</span><span class="p">:</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">date</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">payee</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">postings</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
<span class="n">metadata</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">_generate_id</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">date</span><span class="p">)</span> <span class="o">==</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">:</span>
<span class="n">date</span> <span class="o">=</span> <span class="n">date</span><span class="o">.</span><span class="n">date</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="nb">id</span>
<span class="bp">self</span><span class="o">.</span><span class="n">date</span> <span class="o">=</span> <span class="n">date</span>
<span class="bp">self</span><span class="o">.</span><span class="n">payee</span> <span class="o">=</span> <span class="n">payee</span>
@ -80,6 +84,9 @@
<div class="viewcode-block" id="Transaction.generate_id"><a class="viewcode-back" href="../../api/accounting.html#accounting.models.Transaction.generate_id">[docs]</a> <span class="k">def</span> <span class="nf">generate_id</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="o">.</span><span class="n">uuid4</span><span class="p">())</span>
</div>
<span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__dict__</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">__dict__</span>
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="p">(</span><span class="s">&#39;&lt;{self.__class__.__name__} {self.id} {date}&#39;</span> <span class="o">+</span>
<span class="s">&#39; {self.payee} {self.postings}&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
@ -93,6 +100,9 @@
<span class="bp">self</span><span class="o">.</span><span class="n">amount</span> <span class="o">=</span> <span class="n">amount</span>
<span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="n">metadata</span> <span class="k">if</span> <span class="n">metadata</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="k">else</span> <span class="p">{}</span>
<span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__dict__</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">__dict__</span>
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="p">(</span><span class="s">&#39;&lt;{self.__class__.__name__} &quot;{self.account}&quot;&#39;</span> <span class="o">+</span>
<span class="s">&#39; {self.amount}&gt;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">=</span><span class="bp">self</span><span class="p">)</span>
@ -103,6 +113,9 @@
<span class="bp">self</span><span class="o">.</span><span class="n">amount</span> <span class="o">=</span> <span class="n">Decimal</span><span class="p">(</span><span class="n">amount</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">symbol</span> <span class="o">=</span> <span class="n">symbol</span>
<span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__dict__</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">__dict__</span>
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="p">(</span><span class="s">&#39;&lt;{self.__class__.__name__} {self.symbol}&#39;</span> <span class="o">+</span>
<span class="s">&#39; {self.amount}&gt;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">=</span><span class="bp">self</span><span class="p">)</span>
@ -114,6 +127,9 @@
<span class="bp">self</span><span class="o">.</span><span class="n">amounts</span> <span class="o">=</span> <span class="n">amounts</span>
<span class="bp">self</span><span class="o">.</span><span class="n">accounts</span> <span class="o">=</span> <span class="n">accounts</span>
<span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__dict__</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">__dict__</span>
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="p">(</span><span class="s">&#39;&lt;{self.__class__.__name__} &quot;{self.name}&quot; {self.amounts}&#39;</span> <span class="o">+</span>
<span class="s">&#39; {self.accounts}&gt;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">=</span><span class="bp">self</span><span class="p">)</span></div>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
@ -63,8 +63,6 @@
<span class="kn">from</span> <span class="nn">abc</span> <span class="kn">import</span> <span class="n">ABCMeta</span><span class="p">,</span> <span class="n">abstractmethod</span>
<span class="kn">from</span> <span class="nn">accounting.exceptions</span> <span class="kn">import</span> <span class="n">AccountingException</span>
<div class="viewcode-block" id="Storage"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage">[docs]</a><span class="k">class</span> <span class="nc">Storage</span><span class="p">:</span>
<span class="sd">&#39;&#39;&#39;</span>
@ -105,11 +103,7 @@
</div>
<span class="nd">@abstractmethod</span>
<div class="viewcode-block" id="Storage.reverse_transaction"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.reverse_transaction">[docs]</a> <span class="k">def</span> <span class="nf">reverse_transaction</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">transaction_id</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
</div></div>
<div class="viewcode-block" id="TransactionNotFound"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.TransactionNotFound">[docs]</a><span class="k">class</span> <span class="nc">TransactionNotFound</span><span class="p">(</span><span class="n">AccountingException</span><span class="p">):</span>
<span class="k">pass</span></div>
<span class="k">raise</span> <span class="ne">NotImplementedError</span></div></div>
</pre></div>
</div>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../storage.html" accesskey="U">accounting.storage</a> &raquo;</li>
@ -72,9 +72,9 @@
<span class="kn">from</span> <span class="nn">xml.etree</span> <span class="kn">import</span> <span class="n">ElementTree</span>
<span class="kn">from</span> <span class="nn">contextlib</span> <span class="kn">import</span> <span class="n">contextmanager</span>
<span class="kn">from</span> <span class="nn">accounting.exceptions</span> <span class="kn">import</span> <span class="n">AccountingException</span>
<span class="kn">from</span> <span class="nn">accounting.exceptions</span> <span class="kn">import</span> <span class="n">AccountingException</span><span class="p">,</span> <span class="n">TransactionNotFound</span>
<span class="kn">from</span> <span class="nn">accounting.models</span> <span class="kn">import</span> <span class="n">Account</span><span class="p">,</span> <span class="n">Transaction</span><span class="p">,</span> <span class="n">Posting</span><span class="p">,</span> <span class="n">Amount</span>
<span class="kn">from</span> <span class="nn">accounting.storage</span> <span class="kn">import</span> <span class="n">Storage</span><span class="p">,</span> <span class="n">TransactionNotFound</span>
<span class="kn">from</span> <span class="nn">accounting.storage</span> <span class="kn">import</span> <span class="n">Storage</span>
<span class="n">_log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>
@ -189,6 +189,10 @@
<span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
<span class="n">line</span> <span class="o">=</span> <span class="n">process</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="c"># XXX: This is a hack</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">pass</span>
<span class="c">#_log.debug(&#39;line: %s&#39;, line)</span>
<span class="n">output</span> <span class="o">+=</span> <span class="n">line</span>
<span class="k">if</span> <span class="n">b</span><span class="s">&#39;</span><span class="se">\n</span><span class="s">] &#39;</span> <span class="ow">in</span> <span class="n">output</span><span class="p">:</span>
@ -208,6 +212,8 @@
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">command</span> <span class="o">=</span> <span class="n">command</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">&#39;utf8&#39;</span><span class="p">)</span>
<span class="n">_log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;Sending command: </span><span class="si">%r</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">command</span><span class="p">)</span>
<span class="n">p</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">command</span> <span class="o">+</span> <span class="n">b</span><span class="s">&#39;</span><span class="se">\n</span><span class="s">&#39;</span><span class="p">)</span>
<span class="n">p</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span>
@ -265,6 +271,8 @@
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ledger_file</span><span class="p">,</span> <span class="s">&#39;ab&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">output</span><span class="p">)</span>
<span class="n">_log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&#39;Added transaction </span><span class="si">%s</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">transaction</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="n">_log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;written to file: </span><span class="si">%s</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">output</span><span class="p">)</span>
<span class="k">return</span> <span class="n">transaction</span><span class="o">.</span><span class="n">id</span>
@ -323,8 +331,8 @@
<span class="k">if</span> <span class="n">transaction</span><span class="o">.</span><span class="n">id</span> <span class="o">==</span> <span class="n">transaction_id</span><span class="p">:</span>
<span class="k">return</span> <span class="n">transaction</span>
<span class="k">raise</span> <span class="n">TransactionNotFound</span><span class="p">(</span><span class="s">&#39;No transaction with id </span><span class="si">%s</span><span class="s"> found&#39;</span><span class="p">,</span>
<span class="n">transaction_id</span><span class="p">)</span>
<span class="k">raise</span> <span class="n">TransactionNotFound</span><span class="p">(</span>
<span class="s">&#39;No transaction with id {0} found&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">transaction_id</span><span class="p">))</span>
</div>
<div class="viewcode-block" id="Ledger.reg"><a class="viewcode-back" href="../../../api/accounting.storage.html#accounting.storage.ledgercli.Ledger.reg">[docs]</a> <span class="k">def</span> <span class="nf">reg</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">output</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">send_command</span><span class="p">(</span><span class="s">&#39;xml&#39;</span><span class="p">)</span>
@ -473,6 +481,11 @@
<span class="c"># Delete the preceding line to make the file</span>
<span class="n">del_start</span> <span class="o">-=</span> <span class="mi">1</span>
<span class="n">_log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&#39;Removing transaction with ID: </span><span class="si">%s</span><span class="s"> (lines </span><span class="si">%d</span><span class="s">-</span><span class="si">%d</span><span class="s">)&#39;</span><span class="p">,</span>
<span class="n">transaction_id</span><span class="p">,</span>
<span class="n">del_start</span><span class="p">,</span>
<span class="n">semantic_lines</span><span class="p">[</span><span class="s">&#39;next_transaction_or_eof&#39;</span><span class="p">])</span>
<span class="k">del</span> <span class="n">lines</span><span class="p">[</span><span class="n">del_start</span><span class="p">:</span><span class="n">semantic_lines</span><span class="p">[</span><span class="s">&#39;next_transaction_or_eof&#39;</span><span class="p">]]</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ledger_file</span><span class="p">,</span> <span class="s">&#39;w&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
@ -498,6 +511,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">add_transaction</span><span class="p">(</span><span class="n">transaction</span><span class="p">)</span>
<span class="n">_log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&#39;Updated transaction </span><span class="si">%s</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">transaction</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
<span class="n">_log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;Updated transaction from: </span><span class="si">%s</span><span class="s"> to: </span><span class="si">%s</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">old_transaction</span><span class="p">,</span>
<span class="n">transaction</span><span class="p">)</span>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../../index.html" >Module code</a> &raquo;</li>
<li><a href="../storage.html" accesskey="U">accounting.storage</a> &raquo;</li>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../../../index.html" >Module code</a> &raquo;</li>
<li><a href="../../storage.html" >accounting.storage</a> &raquo;</li>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
@ -65,6 +65,7 @@
<span class="kn">from</span> <span class="nn">flask</span> <span class="kn">import</span> <span class="n">json</span>
<span class="kn">from</span> <span class="nn">accounting.exceptions</span> <span class="kn">import</span> <span class="n">AccountingException</span>
<span class="kn">from</span> <span class="nn">accounting.models</span> <span class="kn">import</span> <span class="n">Amount</span><span class="p">,</span> <span class="n">Transaction</span><span class="p">,</span> <span class="n">Posting</span><span class="p">,</span> <span class="n">Account</span>
@ -99,10 +100,10 @@
<span class="n">amount</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">o</span><span class="o">.</span><span class="n">amount</span><span class="p">),</span>
<span class="n">symbol</span><span class="o">=</span><span class="n">o</span><span class="o">.</span><span class="n">symbol</span>
<span class="p">)</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">o</span><span class="p">,</span> <span class="ne">Exception</span><span class="p">):</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">o</span><span class="p">,</span> <span class="n">AccountingException</span><span class="p">):</span>
<span class="k">return</span> <span class="nb">dict</span><span class="p">(</span>
<span class="n">__type__</span><span class="o">=</span><span class="n">o</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span>
<span class="n">args</span><span class="o">=</span><span class="n">o</span><span class="o">.</span><span class="n">args</span>
<span class="nb">type</span><span class="o">=</span><span class="n">o</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span>
<span class="n">message</span><span class="o">=</span><span class="n">o</span><span class="o">.</span><span class="n">message</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">JSONEncoder</span><span class="o">.</span><span class="n">default</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">o</span><span class="p">)</span>
@ -117,7 +118,7 @@
<span class="k">return</span> <span class="n">d</span>
<span class="n">types</span> <span class="o">=</span> <span class="p">{</span><span class="n">c</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span> <span class="n">c</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="p">[</span><span class="n">Amount</span><span class="p">,</span> <span class="n">Transaction</span><span class="p">,</span> <span class="n">Posting</span><span class="p">,</span>
<span class="n">Account</span><span class="p">]}</span>
<span class="n">Account</span><span class="p">,</span> <span class="n">AccountingException</span><span class="p">]}</span>
<span class="n">_type</span> <span class="o">=</span> <span class="n">d</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s">&#39;__type__&#39;</span><span class="p">)</span>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
<li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
@ -69,7 +69,7 @@
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">argparse</span>
<span class="kn">from</span> <span class="nn">flask</span> <span class="kn">import</span> <span class="n">Flask</span><span class="p">,</span> <span class="n">jsonify</span><span class="p">,</span> <span class="n">request</span><span class="p">,</span> <span class="n">render_template</span>
<span class="kn">from</span> <span class="nn">flask</span> <span class="kn">import</span> <span class="n">Flask</span><span class="p">,</span> <span class="n">jsonify</span><span class="p">,</span> <span class="n">request</span><span class="p">,</span> <span class="n">render_template</span><span class="p">,</span> <span class="n">abort</span>
<span class="kn">from</span> <span class="nn">flask.ext.script</span> <span class="kn">import</span> <span class="n">Manager</span>
<span class="kn">from</span> <span class="nn">flask.ext.migrate</span> <span class="kn">import</span> <span class="n">Migrate</span><span class="p">,</span> <span class="n">MigrateCommand</span>
@ -78,32 +78,18 @@
<span class="kn">from</span> <span class="nn">accounting.storage.ledgercli</span> <span class="kn">import</span> <span class="n">Ledger</span>
<span class="kn">from</span> <span class="nn">accounting.storage.sql</span> <span class="kn">import</span> <span class="n">SQLStorage</span>
<span class="kn">from</span> <span class="nn">accounting.transport</span> <span class="kn">import</span> <span class="n">AccountingEncoder</span><span class="p">,</span> <span class="n">AccountingDecoder</span>
<span class="kn">from</span> <span class="nn">accounting.exceptions</span> <span class="kn">import</span> <span class="n">AccountingException</span>
<span class="kn">from</span> <span class="nn">accounting.exceptions</span> <span class="kn">import</span> <span class="n">AccountingException</span><span class="p">,</span> <span class="n">TransactionNotFound</span>
<span class="kn">from</span> <span class="nn">accounting.decorators</span> <span class="kn">import</span> <span class="n">jsonify_exceptions</span><span class="p">,</span> <span class="n">cors</span>
<span class="n">app</span> <span class="o">=</span> <span class="n">Flask</span><span class="p">(</span><span class="s">&#39;accounting&#39;</span><span class="p">)</span>
<span class="n">app</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">from_pyfile</span><span class="p">(</span><span class="s">&#39;config.py&#39;</span><span class="p">)</span>
<span class="n">storage</span> <span class="o">=</span> <span class="n">Storage</span><span class="p">()</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">storage</span><span class="p">,</span> <span class="n">SQLStorage</span><span class="p">):</span>
<span class="c"># TODO: Move migration stuff into SQLStorage</span>
<span class="n">db</span> <span class="o">=</span> <span class="n">storage</span><span class="o">.</span><span class="n">db</span>
<span class="n">migrate</span> <span class="o">=</span> <span class="n">Migrate</span><span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="n">db</span><span class="p">)</span>
<span class="n">manager</span> <span class="o">=</span> <span class="n">Manager</span><span class="p">(</span><span class="n">app</span><span class="p">)</span>
<span class="n">manager</span><span class="o">.</span><span class="n">add_command</span><span class="p">(</span><span class="s">&#39;db&#39;</span><span class="p">,</span> <span class="n">MigrateCommand</span><span class="p">)</span>
<span class="n">app</span><span class="o">.</span><span class="n">ledger</span> <span class="o">=</span> <span class="n">Storage</span><span class="p">()</span>
<span class="nd">@app.before_request</span>
<div class="viewcode-block" id="init_ledger"><a class="viewcode-back" href="../../api/accounting.html#accounting.web.init_ledger">[docs]</a><span class="k">def</span> <span class="nf">init_ledger</span><span class="p">():</span>
<span class="sd">&#39;&#39;&#39;</span>
<span class="sd"> :py:meth:`flask.Flask.before_request`-decorated method that initializes an</span>
<span class="sd"> :py:class:`accounting.Ledger` object.</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="k">global</span> <span class="n">ledger</span>
<span class="c">#ledger = Ledger(ledger_file=app.config[&#39;LEDGER_FILE&#39;])</span>
<span class="n">app</span><span class="o">.</span><span class="n">ledger</span> <span class="o">=</span> <span class="n">Ledger</span><span class="p">(</span><span class="n">app</span><span class="p">)</span>
<span class="c"># These will convert output from our internal classes to JSON and back</span></div>
@ -144,9 +130,12 @@
<span class="sd"> Returns the JSON-serialized output of :meth:`accounting.Ledger.reg`</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="k">if</span> <span class="n">transaction_id</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">transactions</span><span class="o">=</span><span class="n">storage</span><span class="o">.</span><span class="n">get_transactions</span><span class="p">())</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">transactions</span><span class="o">=</span><span class="n">app</span><span class="o">.</span><span class="n">ledger</span><span class="o">.</span><span class="n">get_transactions</span><span class="p">())</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="n">storage</span><span class="o">.</span><span class="n">get_transaction</span><span class="p">(</span><span class="n">transaction_id</span><span class="p">))</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">transaction</span><span class="o">=</span><span class="n">app</span><span class="o">.</span><span class="n">ledger</span><span class="o">.</span><span class="n">get_transaction</span><span class="p">(</span><span class="n">transaction_id</span><span class="p">))</span>
<span class="k">except</span> <span class="n">TransactionNotFound</span><span class="p">:</span>
<span class="n">abort</span><span class="p">(</span><span class="mi">404</span><span class="p">)</span>
</div>
<span class="nd">@app.route</span><span class="p">(</span><span class="s">&#39;/transaction/&lt;string:transaction_id&gt;&#39;</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;POST&#39;</span><span class="p">])</span>
@ -164,7 +153,7 @@
<span class="k">elif</span> <span class="n">transaction</span><span class="o">.</span><span class="n">id</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">transaction</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="n">transaction_id</span>
<span class="n">storage</span><span class="o">.</span><span class="n">update_transaction</span><span class="p">(</span><span class="n">transaction</span><span class="p">)</span>
<span class="n">app</span><span class="o">.</span><span class="n">ledger</span><span class="o">.</span><span class="n">update_transaction</span><span class="p">(</span><span class="n">transaction</span><span class="p">)</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&#39;OK&#39;</span><span class="p">)</span>
@ -176,7 +165,7 @@
<span class="k">if</span> <span class="n">transaction_id</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">AccountingException</span><span class="p">(</span><span class="s">&#39;Transaction ID cannot be None&#39;</span><span class="p">)</span>
<span class="n">storage</span><span class="o">.</span><span class="n">delete_transaction</span><span class="p">(</span><span class="n">transaction_id</span><span class="p">)</span>
<span class="n">app</span><span class="o">.</span><span class="n">ledger</span><span class="o">.</span><span class="n">delete_transaction</span><span class="p">(</span><span class="n">transaction_id</span><span class="p">)</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&#39;OK&#39;</span><span class="p">)</span>
@ -243,7 +232,7 @@
<span class="n">transaction_ids</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">transaction</span> <span class="ow">in</span> <span class="n">transactions</span><span class="p">:</span>
<span class="n">transaction_ids</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">storage</span><span class="o">.</span><span class="n">add_transaction</span><span class="p">(</span><span class="n">transaction</span><span class="p">))</span>
<span class="n">transaction_ids</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">app</span><span class="o">.</span><span class="n">ledger</span><span class="o">.</span><span class="n">add_transaction</span><span class="p">(</span><span class="n">transaction</span><span class="p">))</span>
<span class="k">return</span> <span class="n">jsonify</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&#39;OK&#39;</span><span class="p">,</span> <span class="n">transaction_ids</span><span class="o">=</span><span class="n">transaction_ids</span><span class="p">)</span>
@ -260,8 +249,7 @@
<span class="n">help</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;Filter logging output. Possible values:&#39;</span> <span class="o">+</span>
<span class="s">&#39; CRITICAL, ERROR, WARNING, INFO, DEBUG&#39;</span><span class="p">))</span>
<span class="k">global</span> <span class="n">storage</span>
<span class="n">storage</span> <span class="o">=</span> <span class="n">Ledger</span><span class="p">(</span><span class="n">app</span><span class="o">=</span><span class="n">app</span><span class="p">)</span>
<span class="n">init_ledger</span><span class="p">()</span>
<span class="n">args</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">parse_args</span><span class="p">(</span><span class="n">argv</span><span class="p">)</span>

View file

@ -39,12 +39,12 @@
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
</ul>
</div>

View file

@ -1,8 +1,8 @@
.. vim: textwith=80
.. vim: textwidth=80
====================
The Accounting API
====================
=======================
accounting-api README
=======================
--------------
Dependencies

View file

@ -1,10 +1,6 @@
.. Accounting API documentation master file, created by
sphinx-quickstart on Thu Dec 12 14:02:01 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Accounting API's documentation!
==========================================
=======
Index
=======
-----------------------
Accounting API

View file

@ -1,6 +1,10 @@
==========
REST API
==========
========================
REST API Documentation
========================
The accounting-api projects main application provides a REST API for accounting
data. This is the documentation for the various REST endpoints that the
accounting-api application provides.
Get transactions
----------------
@ -28,63 +32,63 @@ Get transactions
{
"transactions": [
{
"__type__": "Transaction",
"date": "2010-01-01",
"id": "Ids can be anything",
"metadata": {},
"payee": "Kindly T. Donor",
"__type__": "Transaction",
"date": "2010-01-01",
"id": "Ids can be anything",
"metadata": {},
"payee": "Kindly T. Donor",
"postings": [
{
"__type__": "Posting",
"account": "Income:Foo:Donation",
"__type__": "Posting",
"account": "Income:Foo:Donation",
"amount": {
"__type__": "Amount",
"amount": "-100",
"__type__": "Amount",
"amount": "-100",
"symbol": "$"
},
},
"metadata": {
"Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf"
}
},
},
{
"__type__": "Posting",
"account": "Assets:Checking",
"__type__": "Posting",
"account": "Assets:Checking",
"amount": {
"__type__": "Amount",
"amount": "100",
"__type__": "Amount",
"amount": "100",
"symbol": "$"
},
},
"metadata": {}
}
]
},
},
{
"__type__": "Transaction",
"date": "2011-03-15",
"id": "but mind you if they collide.",
"metadata": {},
"payee": "Another J. Donor",
"__type__": "Transaction",
"date": "2011-03-15",
"id": "but mind you if they collide.",
"metadata": {},
"payee": "Another J. Donor",
"postings": [
{
"__type__": "Posting",
"account": "Income:Foo:Donation",
"__type__": "Posting",
"account": "Income:Foo:Donation",
"amount": {
"__type__": "Amount",
"amount": "-400",
"__type__": "Amount",
"amount": "-400",
"symbol": "$"
},
},
"metadata": {
"Approval": "Projects/Foo/earmark-record.txt"
}
},
},
{
"__type__": "Posting",
"account": "Assets:Checking",
"__type__": "Posting",
"account": "Assets:Checking",
"amount": {
"__type__": "Amount",
"amount": "400",
"__type__": "Amount",
"amount": "400",
"symbol": "$"
},
},
"metadata": {}
}
]
@ -111,36 +115,36 @@ Add transactions
{
"transactions": [
{
"__type__": "Transaction",
"date": "2010-01-01",
"id": "Ids can be anything",
"metadata": {},
"payee": "Kindly T. Donor",
"__type__": "Transaction",
"date": "2010-01-01",
"id": "Ids can be anything",
"metadata": {},
"payee": "Kindly T. Donor",
"postings": [
{
"__type__": "Posting",
"account": "Income:Foo:Donation",
"__type__": "Posting",
"account": "Income:Foo:Donation",
"amount": {
"__type__": "Amount",
"amount": "-100",
"__type__": "Amount",
"amount": "-100",
"symbol": "$"
},
},
"metadata": {
"Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf"
}
},
},
{
"__type__": "Posting",
"account": "Assets:Checking",
"__type__": "Posting",
"account": "Assets:Checking",
"amount": {
"__type__": "Amount",
"amount": "100",
"__type__": "Amount",
"amount": "100",
"symbol": "$"
},
},
"metadata": {}
}
]
},
},
]
}

View file

@ -7,10 +7,18 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="167.00000pt"
id="svg951"
inkscape:version="0.48.4 r9939"
sodipodi:docname="accounting-api-logo.svg"
sodipodi:version="0.32"
width="300.00000pt"
version="1.1"
width="300pt"
height="167pt"
id="svg951">
inkscape:export-filename="/home/joar/git/accounting-api/doc/source/_static/accounting-api-logo.png"
inkscape:export-xdpi="49.176128"
inkscape:export-ydpi="49.176128">
<metadata
id="metadata3035">
<rdf:RDF>
@ -63,28 +71,50 @@
</metadata>
<defs
id="defs953" />
<sodipodi:namedview
bordercolor="#666666"
borderopacity="1.0"
id="base"
inkscape:cx="674.07751"
inkscape:cy="-393.57362"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:window-height="1029"
inkscape:window-width="1920"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:zoom="0.483"
pagecolor="#ffffff"
showgrid="false"
inkscape:window-maximized="1"
inkscape:current-layer="g2198" />
<g
transform="translate(-256.9943,-227.944)"
id="g2198">
id="g2198"
transform="translate(-256.9943,-227.9440)">
<path
d="m 264.66115,311.01114 c 24.93922,41.90468 47.33363,76.68386 72.27285,118.58855 51.23569,-24.59991 72.95147,-32.913 117.57063,-48.35156 19.51028,5.5986 40.03848,-4.58067 48.35156,-12.21514 36.81504,-5.08964 79.73764,-11.1972 121.13336,-15.26891 -1.01793,-6.61653 1.01793,-9.16134 0,-15.77787 -42.92261,-31.3861 -86.35417,-64.29909 -129.27678,-95.68519 -78.38042,22.22475 -151.6712,46.48536 -230.05162,68.71012 z"
d="M 264.66115,311.01114 C 289.60037,352.91582 311.99478,387.69500 336.93400,429.59969 C 388.16969,404.99978 409.88547,396.68669 454.50463,381.24813 C 474.01491,386.84673 494.54311,376.66746 502.85619,369.03299 C 539.67123,363.94335 582.59383,357.83579 623.98955,353.76408 C 622.97162,347.14755 625.00748,344.60274 623.98955,337.98621 C 581.06694,306.60011 537.63538,273.68712 494.71277,242.30102 C 416.33235,264.52577 343.04157,288.78638 264.66115,311.01114 z "
id="path14684"
sodipodi:nodetypes="cccccccc"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#fefefe;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
<path
d="m 274.33146,312.53802 c 22.39441,35.62746 44.78881,71.25493 67.18322,106.88239 39.69917,-20.86751 86.82198,-51.95048 123.68878,-43.64739 -1.78947,-12.27188 3.97878,-19.14539 11.18661,-27.09857 -59.88807,-10.34893 -89.74727,24.09095 -132.33057,40.7171 -0.84827,8.65238 -1.69655,17.30477 -2.54482,25.95715 1.18758,-8.31307 1.35723,-16.62615 2.54481,-24.93922 -19.34062,-30.02886 -42.24398,-67.69219 -61.5846,-97.72105 -6.27723,3.05378 -6.95584,12.7241 -8.14343,19.84959 z"
d="M 274.33146,312.53802 C 296.72587,348.16548 319.12027,383.79295 341.51468,419.42041 C 381.21385,398.55290 428.33666,367.46993 465.20346,375.77302 C 463.41399,363.50114 469.18224,356.62763 476.39007,348.67445 C 416.50200,338.32552 386.64280,372.76540 344.05950,389.39155 C 343.21123,398.04393 342.36295,406.69632 341.51468,415.34870 C 342.70226,407.03563 342.87191,398.72255 344.05949,390.40948 C 324.71887,360.38062 301.81551,322.71729 282.47489,292.68843 C 276.19766,295.74221 275.51905,305.41253 274.33146,312.53802 z "
id="path14685"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
sodipodi:nodetypes="ccccccccc"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.75000000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
<path
d="m 470.79147,360.38062 c 16.45649,-31.3861 29.80263,-33.60346 62.09358,-38.17229 25.29841,-3.57946 43.03551,-2.73505 68.82301,-3.92264 -2.20551,7.46481 1.58365,17.32535 4.97674,27.33497 -24.26061,1.01793 -43.43158,-0.50896 -70.237,3.05378 -17.81374,-1.52689 -33.59162,9.67032 -45.29778,21.37648 1.01793,-21.71578 -11.19721,-8.31306 -20.35855,-9.6703 z"
d="M 470.79147,360.38062 C 487.24796,328.99452 500.59410,326.77716 532.88505,322.20833 C 558.18346,318.62887 575.92056,319.47328 601.70806,318.28569 C 599.50255,325.75050 603.29171,335.61104 606.68480,345.62066 C 582.42419,346.63859 563.25322,345.11170 536.44780,348.67444 C 518.63406,347.14755 502.85618,358.34476 491.15002,370.05092 C 492.16795,348.33514 479.95281,361.73786 470.79147,360.38062 z "
id="path14686"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
sodipodi:nodetypes="csccccc"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.75000000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
<path
d="m 396.48276,273.85678 c 25.44819,24.59991 50.89638,49.19983 76.34457,73.79974 -61.66944,-7.63446 -94.58244,29.77437 -129.2768,41.98951 -20.01924,-31.72541 -41.31089,-65.48667 -61.33013,-97.21208 25.10888,-12.04547 41.68577,-31.89095 78.12594,-34.86401 14.12444,-1.15238 25.10888,8.31307 36.13642,16.28684 z"
d="M 396.48276,273.85678 C 421.93095,298.45669 447.37914,323.05661 472.82733,347.65652 C 411.15789,340.02206 378.24489,377.43089 343.55053,389.64603 C 323.53129,357.92062 302.23964,324.15936 282.22040,292.43395 C 307.32928,280.38848 323.90617,260.54300 360.34634,257.56994 C 374.47078,256.41756 385.45522,265.88301 396.48276,273.85678 z "
id="path14687"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
sodipodi:nodetypes="ccccsc"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.50000000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
<path
d="m 476.49663,348.91674 c 18.9543,-32.03036 58.06253,-27.35177 124.88243,-32.39025 -35.26939,-23.99278 -70.53878,-47.98557 -105.80817,-71.97835 -46.1861,8.9973 -77.25675,-10.07697 -102.20924,25.55232 l 83.13498,78.81628 z"
d="M 476.49663,348.91674 C 495.45093,316.88638 534.55916,321.56497 601.37906,316.52649 C 566.10967,292.53371 530.84028,268.54092 495.57089,244.54814 C 449.38479,253.54544 418.31414,234.47117 393.36165,270.10046 L 476.49663,348.91674 z "
id="path950"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
sodipodi:nodetypes="ccccc"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.50000000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View file

@ -189,12 +189,18 @@ exceptions which are returned to the client as JSON.</p>
<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><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>
<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.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>
@ -330,9 +336,7 @@ and the Flask endpoints.</p>
<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><p><a class="reference external" href="http://flask.pocoo.org/docs/api/#flask.Flask.before_request" title="(in Flask v0.10)"><tt class="xref py py-meth docutils literal"><span class="pre">flask.Flask.before_request()</span></tt></a>-decorated method that initializes an
<tt class="xref py py-class docutils literal"><span class="pre">accounting.Ledger</span></tt> object.</p>
</dd></dl>
<dd></dd></dl>
<dl class="function">
<dt id="accounting.web.main">

View file

@ -244,12 +244,6 @@ the old transaction using <tt class="xref py py-data docutils literal"><span cla
</dd></dl>
<dl class="exception">
<dt id="accounting.storage.TransactionNotFound">
<em class="property">exception </em><tt class="descclassname">accounting.storage.</tt><tt class="descname">TransactionNotFound</tt><a class="reference internal" href="../_modules/accounting/storage.html#TransactionNotFound"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.TransactionNotFound" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="accounting.html#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>

View file

@ -40,12 +40,12 @@
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
</ul>
</div>
@ -610,7 +610,7 @@
</dt>
<dt><a href="api/accounting.storage.html#accounting.storage.TransactionNotFound">TransactionNotFound</a>
<dt><a href="api/accounting.html#accounting.exceptions.TransactionNotFound">TransactionNotFound</a>
</dt>
</dl></td>

View file

@ -46,12 +46,12 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="#" title="HTTP Routing Table"
>routing table</a> |</li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="#" title="HTTP Routing Table"
>routing table</a> |</li>
<li><a href="index.html">Accounting API 0.1-beta documentation</a> &raquo;</li>
</ul>
</div>
@ -75,12 +75,12 @@
<tr>
<td></td>
<td>
<a href="restapi.html#post--transaction"><tt class="xref">POST /transaction</tt></a></td><td>
<a href="restapi.html#get--transaction"><tt class="xref">GET /transaction</tt></a></td><td>
<em></em></td></tr>
<tr>
<td></td>
<td>
<a href="restapi.html#get--transaction"><tt class="xref">GET /transaction</tt></a></td><td>
<a href="restapi.html#post--transaction"><tt class="xref">POST /transaction</tt></a></td><td>
<em></em></td></tr>
<tr>
<td></td>

View file

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to Accounting APIs documentation! &mdash; Accounting API 0.1-beta documentation</title>
<title>Index &mdash; 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" />
@ -24,7 +24,7 @@
<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="#" />
<link rel="next" title="The Accounting API" href="README.html" />
<link rel="next" title="accounting-api README" href="README.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
@ -42,14 +42,14 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="http-routingtable.html" title="HTTP Routing Table"
>routing table</a> |</li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="README.html" title="The Accounting API"
<a href="http-routingtable.html" title="HTTP Routing Table"
>routing table</a> |</li>
<li class="right" >
<a href="README.html" title="accounting-api README"
accesskey="N">next</a> |</li>
<li><a href="#">Accounting API 0.1-beta documentation</a> &raquo;</li>
</ul>
@ -60,20 +60,20 @@
<div class="bodywrapper">
<div class="body">
<div class="section" id="welcome-to-accounting-api-s-documentation">
<h1>Welcome to Accounting API&#8217;s documentation!<a class="headerlink" href="#welcome-to-accounting-api-s-documentation" title="Permalink to this headline"></a></h1>
<div class="section" id="index">
<h1>Index<a class="headerlink" href="#index" title="Permalink to this headline"></a></h1>
<div class="section" id="accounting-api">
<h2>Accounting API<a class="headerlink" href="#accounting-api" title="Permalink to this headline"></a></h2>
<p>Contents:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">The Accounting API</a><ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">accounting-api README</a><ul>
<li class="toctree-l2"><a class="reference internal" href="README.html#dependencies">Dependencies</a></li>
<li class="toctree-l2"><a class="reference internal" href="README.html#installation-i-e-development-setup">Installation (i.e. Development Setup)</a></li>
<li class="toctree-l2"><a class="reference internal" href="README.html#usage">Usage</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="restapi.html">REST API</a><ul>
<li class="toctree-l1"><a class="reference internal" href="restapi.html">REST API Documentation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="restapi.html#get-transactions">Get transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="restapi.html#add-transactions">Add transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="restapi.html#delete-a-transaction">Delete a transaction</a></li>
@ -81,15 +81,15 @@
</li>
</ul>
</div>
</div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h1>
<h3>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
<li><a class="reference internal" href="py-modindex.html"><em>Module Index</em></a></li>
<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
</ul>
</div>
</div>
</div>
@ -103,18 +103,18 @@
</a></p>
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Welcome to Accounting API&#8217;s documentation!</a><ul>
<li><a class="reference internal" href="#">Index</a><ul>
<li><a class="reference internal" href="#accounting-api">Accounting API</a><ul>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="#">Documentation overview</a><ul>
<li>Next: <a href="README.html" title="next chapter">The Accounting API</a></li>
<li>Next: <a href="README.html" title="next chapter">accounting-api README</a></li>
</ul></li>
</ul>
<h3>This Page</h3>

Binary file not shown.

View file

@ -42,12 +42,12 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="http-routingtable.html" title="HTTP Routing Table"
>routing table</a> |</li>
<li class="right" >
<a href="#" 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> &raquo;</li>
</ul>
</div>

View file

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>REST API &mdash; Accounting API 0.1-beta documentation</title>
<title>REST API Documentation &mdash; 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" />
@ -24,7 +24,7 @@
<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" />
<link rel="prev" title="The Accounting API" href="README.html" />
<link rel="prev" title="accounting-api README" href="README.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
@ -47,7 +47,7 @@
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="README.html" title="The Accounting API"
<a href="README.html" title="accounting-api README"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Accounting API 0.1-beta documentation</a> &raquo;</li>
</ul>
@ -58,8 +58,11 @@
<div class="bodywrapper">
<div class="body">
<div class="section" id="rest-api">
<h1>REST API<a class="headerlink" href="#rest-api" title="Permalink to this headline"></a></h1>
<div class="section" id="rest-api-documentation">
<h1>REST API Documentation<a class="headerlink" href="#rest-api-documentation" title="Permalink to this headline"></a></h1>
<p>The accounting-api projects main application provides a REST API for accounting
data. This is the documentation for the various REST endpoints that the
accounting-api application provides.</p>
<div class="section" id="get-transactions">
<h2>Get transactions<a class="headerlink" href="#get-transactions" title="Permalink to this headline"></a></h2>
<dl class="get">
@ -259,7 +262,7 @@
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">REST API</a><ul>
<li><a class="reference internal" href="#">REST API Documentation</a><ul>
<li><a class="reference internal" href="#get-transactions">Get transactions</a></li>
<li><a class="reference internal" href="#add-transactions">Add transactions</a></li>
<li><a class="reference internal" href="#delete-a-transaction">Delete a transaction</a></li>
@ -269,7 +272,7 @@
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="README.html" title="previous chapter">The Accounting API</a></li>
<li>Previous: <a href="README.html" title="previous chapter">accounting-api README</a></li>
</ul></li>
</ul>
<h3>This Page</h3>

View file

@ -47,12 +47,12 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="http-routingtable.html" title="HTTP Routing Table"
>routing table</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> &raquo;</li>
</ul>
</div>

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,6 @@
.. Accounting API documentation master file, created by
sphinx-quickstart on Thu Dec 12 14:02:01 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Accounting API's documentation!
==========================================
=======
Index
=======
-----------------------
Accounting API

View file

@ -1,6 +1,10 @@
==========
REST API
==========
========================
REST API Documentation
========================
The accounting-api projects main application provides a REST API for accounting
data. This is the documentation for the various REST endpoints that the
accounting-api application provides.
Get transactions
----------------
@ -28,63 +32,63 @@ Get transactions
{
"transactions": [
{
"__type__": "Transaction",
"date": "2010-01-01",
"id": "Ids can be anything",
"metadata": {},
"payee": "Kindly T. Donor",
"__type__": "Transaction",
"date": "2010-01-01",
"id": "Ids can be anything",
"metadata": {},
"payee": "Kindly T. Donor",
"postings": [
{
"__type__": "Posting",
"account": "Income:Foo:Donation",
"__type__": "Posting",
"account": "Income:Foo:Donation",
"amount": {
"__type__": "Amount",
"amount": "-100",
"__type__": "Amount",
"amount": "-100",
"symbol": "$"
},
},
"metadata": {
"Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf"
}
},
},
{
"__type__": "Posting",
"account": "Assets:Checking",
"__type__": "Posting",
"account": "Assets:Checking",
"amount": {
"__type__": "Amount",
"amount": "100",
"__type__": "Amount",
"amount": "100",
"symbol": "$"
},
},
"metadata": {}
}
]
},
},
{
"__type__": "Transaction",
"date": "2011-03-15",
"id": "but mind you if they collide.",
"metadata": {},
"payee": "Another J. Donor",
"__type__": "Transaction",
"date": "2011-03-15",
"id": "but mind you if they collide.",
"metadata": {},
"payee": "Another J. Donor",
"postings": [
{
"__type__": "Posting",
"account": "Income:Foo:Donation",
"__type__": "Posting",
"account": "Income:Foo:Donation",
"amount": {
"__type__": "Amount",
"amount": "-400",
"__type__": "Amount",
"amount": "-400",
"symbol": "$"
},
},
"metadata": {
"Approval": "Projects/Foo/earmark-record.txt"
}
},
},
{
"__type__": "Posting",
"account": "Assets:Checking",
"__type__": "Posting",
"account": "Assets:Checking",
"amount": {
"__type__": "Amount",
"amount": "400",
"__type__": "Amount",
"amount": "400",
"symbol": "$"
},
},
"metadata": {}
}
]
@ -111,36 +115,36 @@ Add transactions
{
"transactions": [
{
"__type__": "Transaction",
"date": "2010-01-01",
"id": "Ids can be anything",
"metadata": {},
"payee": "Kindly T. Donor",
"__type__": "Transaction",
"date": "2010-01-01",
"id": "Ids can be anything",
"metadata": {},
"payee": "Kindly T. Donor",
"postings": [
{
"__type__": "Posting",
"account": "Income:Foo:Donation",
"__type__": "Posting",
"account": "Income:Foo:Donation",
"amount": {
"__type__": "Amount",
"amount": "-100",
"__type__": "Amount",
"amount": "-100",
"symbol": "$"
},
},
"metadata": {
"Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf"
}
},
},
{
"__type__": "Posting",
"account": "Assets:Checking",
"__type__": "Posting",
"account": "Assets:Checking",
"amount": {
"__type__": "Amount",
"amount": "100",
"__type__": "Amount",
"amount": "100",
"symbol": "$"
},
},
"metadata": {}
}
]
},
},
]
}