[doc] Updated restapi documentation
This commit is contained in:
parent
fcec13c548
commit
ef12c232ad
12 changed files with 422 additions and 137 deletions
115
doc/build/html/_sources/restapi.txt
vendored
115
doc/build/html/_sources/restapi.txt
vendored
|
@ -6,13 +6,11 @@ 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
|
||||
Get all transactions
|
||||
----------------
|
||||
|
||||
.. http:get:: /transaction
|
||||
|
||||
Get all transactions
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
@ -96,6 +94,59 @@ Get transactions
|
|||
]
|
||||
}
|
||||
|
||||
|
||||
Get a single transaction
|
||||
------------------------
|
||||
|
||||
.. http:get:: /transaction/<string:transaction_id>
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
GET /transaction/2aeea63b-0996-4ead-bc4c-e15505dff226 HTTP/1.1
|
||||
Host: accounting.example
|
||||
Accept: application/json
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.0 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"transaction": {
|
||||
"__type__": "Transaction",
|
||||
"date": "2013-12-26",
|
||||
"id": "2aeea63b-0996-4ead-bc4c-e15505dff226",
|
||||
"metadata": {},
|
||||
"payee": "January Rent",
|
||||
"postings": [
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-424.24",
|
||||
"symbol": "USD"
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Expenses:Rent",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "424.24",
|
||||
"symbol": "USD"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Add transactions
|
||||
----------------
|
||||
|
||||
|
@ -188,3 +239,61 @@ Delete a transaction
|
|||
{
|
||||
"status": "OK"
|
||||
}
|
||||
|
||||
|
||||
Update a transaction
|
||||
--------------------
|
||||
|
||||
.. http:post:: /transaction/<string:transaction_id>
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
POST /transaction/2aeea63b-0996-4ead-bc4c-e15505dff226 HTTP/1.1
|
||||
Host: accounting.example
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"transaction": {
|
||||
"__type__": "Transaction",
|
||||
"date": "2013-12-26",
|
||||
"id": "2aeea63b-0996-4ead-bc4c-e15505dff226",
|
||||
"metadata": {},
|
||||
"payee": "February Rent",
|
||||
"postings": [
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-424.24",
|
||||
"symbol": "USD"
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Expenses:Rent",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "424.24",
|
||||
"symbol": "USD"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.0 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"status": "OK"
|
||||
}
|
||||
|
|
58
doc/build/html/_static/accounting-api-logo.svg
vendored
58
doc/build/html/_static/accounting-api-logo.svg
vendored
|
@ -7,18 +7,10 @@
|
|||
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"
|
||||
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">
|
||||
width="300pt"
|
||||
height="167pt"
|
||||
id="svg951">
|
||||
<metadata
|
||||
id="metadata3035">
|
||||
<rdf:RDF>
|
||||
|
@ -71,50 +63,28 @@
|
|||
</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
|
||||
id="g2198"
|
||||
transform="translate(-256.9943,-227.9440)">
|
||||
transform="translate(-256.9943,-227.944)"
|
||||
id="g2198">
|
||||
<path
|
||||
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 "
|
||||
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"
|
||||
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 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 "
|
||||
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"
|
||||
id="path14685"
|
||||
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" />
|
||||
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" />
|
||||
<path
|
||||
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 "
|
||||
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"
|
||||
id="path14686"
|
||||
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" />
|
||||
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" />
|
||||
<path
|
||||
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 "
|
||||
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"
|
||||
id="path14687"
|
||||
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" />
|
||||
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" />
|
||||
<path
|
||||
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 "
|
||||
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"
|
||||
id="path950"
|
||||
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" />
|
||||
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" />
|
||||
</g>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 4.8 KiB |
28
doc/build/html/api/accounting.html
vendored
28
doc/build/html/api/accounting.html
vendored
|
@ -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> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -195,6 +195,18 @@ exceptions which are returned to the client as JSON.</p>
|
|||
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>
|
||||
|
@ -223,11 +235,6 @@ jsonify_exceptions decorator</p>
|
|||
<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_new_activate">
|
||||
<tt class="descname">on_transaction_new_activate</tt><big>(</big><em>widget</em><big>)</big><a class="reference internal" href="../_modules/accounting/gtkclient.html#AccountingApplication.on_transaction_new_activate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.gtkclient.AccountingApplication.on_transaction_new_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>
|
||||
|
@ -356,6 +363,11 @@ and the Flask endpoints.</p>
|
|||
<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>
|
||||
|
||||
|
|
61
doc/build/html/api/accounting.storage.html
vendored
61
doc/build/html/api/accounting.storage.html
vendored
|
@ -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> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -89,7 +89,7 @@ writing a ledger transaction based on the
|
|||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.assemble_arguments">
|
||||
<tt class="descname">assemble_arguments</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.assemble_arguments"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.assemble_arguments" title="Permalink to this definition">¶</a></dt>
|
||||
<tt class="descname">assemble_arguments</tt><big>(</big><em>command=None</em><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.assemble_arguments"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.assemble_arguments" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a list of arguments suitable for <a class="reference external" href="http://docs.python.org/3.3/library/subprocess.html#subprocess.Popen" title="(in Python v3.3)"><tt class="xref py py-class docutils literal"><span class="pre">subprocess.Popen</span></tt></a>
|
||||
based on <tt class="xref py py-attr docutils literal"><span class="pre">self.ledger_bin</span></tt> and <tt class="xref py py-attr docutils literal"><span class="pre">self.ledger_file</span></tt>.</p>
|
||||
</dd></dl>
|
||||
|
@ -99,6 +99,12 @@ based on <tt class="xref py py-attr docutils literal"><span class="pre">self.led
|
|||
<tt class="descname">bal</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.bal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.bal" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.commit_changes">
|
||||
<tt class="descname">commit_changes</tt><big>(</big><em>message</em><big>)</big><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.commit_changes" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Commits any changes to <tt class="xref py py-attr docutils literal"><span class="pre">self.ledger_file</span></tt> to the git repository</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.delete_transaction">
|
||||
<tt class="descname">delete_transaction</tt><big>(</big><em>transaction_id</em><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.delete_transaction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.delete_transaction" title="Permalink to this definition">¶</a></dt>
|
||||
|
@ -116,14 +122,6 @@ ledger file.</p>
|
|||
</ul>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.get_process">
|
||||
<tt class="descname">get_process</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.get_process"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.get_process" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns <tt class="xref py py-attr docutils literal"><span class="pre">self.ledger_process</span></tt> if it evaluates to <tt class="docutils literal"><span class="pre">True</span></tt>. If
|
||||
<tt class="xref py py-attr docutils literal"><span class="pre">self.ledger_process</span></tt> is not set the result of
|
||||
<a class="reference internal" href="#accounting.storage.ledgercli.Ledger.init_process" title="accounting.storage.ledgercli.Ledger.init_process"><tt class="xref py py-meth docutils literal"><span class="pre">self.init_process()</span></tt></a> is returned.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.get_transaction">
|
||||
<tt class="descname">get_transaction</tt><big>(</big><em>transaction_id</em><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.get_transaction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.get_transaction" title="Permalink to this definition">¶</a></dt>
|
||||
|
@ -134,39 +132,6 @@ ledger file.</p>
|
|||
<tt class="descname">get_transactions</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.get_transactions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.get_transactions" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.init_process">
|
||||
<tt class="descname">init_process</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.init_process"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.init_process" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Creates a new (presumably) ledger subprocess based on the args from
|
||||
<a class="reference internal" href="#accounting.storage.ledgercli.Ledger.assemble_arguments" title="accounting.storage.ledgercli.Ledger.assemble_arguments"><tt class="xref py py-meth docutils literal"><span class="pre">Ledger.assemble_arguments()</span></tt></a> and then runs
|
||||
<a class="reference internal" href="#accounting.storage.ledgercli.Ledger.read_until_prompt" title="accounting.storage.ledgercli.Ledger.read_until_prompt"><tt class="xref py py-meth docutils literal"><span class="pre">Ledger.read_until_prompt()</span></tt></a> once (which should return the banner
|
||||
text) and discards the output.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.locked_process">
|
||||
<tt class="descname">locked_process</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.locked_process"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.locked_process" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Context manager that checks that the ledger process is not already
|
||||
locked, then “locks” the process and yields the process handle and
|
||||
unlocks the process when execution is returned.</p>
|
||||
<p>Since this decorated as a <a class="reference external" href="http://docs.python.org/3.3/library/contextlib.html#contextlib.contextmanager" title="(in Python v3.3)"><tt class="xref py py-func docutils literal"><span class="pre">contextlib.contextmanager()</span></tt></a> the
|
||||
recommended use is with the <tt class="docutils literal"><span class="pre">with</span></tt>-statement.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">locked_process</span><span class="p">()</span> <span class="k">as</span> <span class="n">p</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">b</span><span class="s">'bal</span><span class="se">\n</span><span class="s">'</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">read_until_prompt</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.read_until_prompt">
|
||||
<tt class="descname">read_until_prompt</tt><big>(</big><em>process</em><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.read_until_prompt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.read_until_prompt" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reads from the subprocess instance <tt class="xref py py-data docutils literal"><span class="pre">process</span></tt> until it finds a
|
||||
combination of <tt class="docutils literal"><span class="pre">\n]\x20</span></tt> (the prompt), then returns the output
|
||||
without the prompt.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.reg">
|
||||
<tt class="descname">reg</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.reg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.reg" title="Permalink to this definition">¶</a></dt>
|
||||
|
@ -175,7 +140,11 @@ without the prompt.</p>
|
|||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.send_command">
|
||||
<tt class="descname">send_command</tt><big>(</big><em>command</em><big>)</big><a class="reference internal" href="../_modules/accounting/storage/ledgercli.html#Ledger.send_command"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#accounting.storage.ledgercli.Ledger.send_command" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
<dd><p>Creates a new ledger process with the specified <tt class="xref py py-data docutils literal"><span class="pre">command</span></tt> and
|
||||
returns the output.</p>
|
||||
<p>Raises an <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">AccountingException</span></tt></a>-based
|
||||
Exception based on the ledger-cli stderr.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="accounting.storage.ledgercli.Ledger.update_transaction">
|
||||
|
|
6
doc/build/html/api/modules.html
vendored
6
doc/build/html/api/modules.html
vendored
|
@ -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> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
36
doc/build/html/genindex.html
vendored
36
doc/build/html/genindex.html
vendored
|
@ -244,6 +244,10 @@
|
|||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="api/accounting.storage.html#accounting.storage.ledgercli.Ledger.commit_changes">commit_changes() (accounting.storage.ledgercli.Ledger method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.decorators.cors">cors() (in module accounting.decorators)</a>
|
||||
</dt>
|
||||
|
||||
|
@ -299,14 +303,10 @@
|
|||
<dt><a href="api/accounting.storage.html#accounting.storage.Storage.get_accounts">get_accounts() (accounting.storage.Storage method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.client.Client.get_balance">get_balance() (accounting.client.Client method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="api/accounting.storage.html#accounting.storage.ledgercli.Ledger.get_process">get_process() (accounting.storage.ledgercli.Ledger method)</a>
|
||||
<dt><a href="api/accounting.html#accounting.client.Client.get_balance">get_balance() (accounting.client.Client method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
|
@ -375,10 +375,6 @@
|
|||
<dt><a href="api/accounting.html#accounting.web.init_ledger">init_ledger() (in module accounting.web)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.storage.html#accounting.storage.ledgercli.Ledger.init_process">init_process() (accounting.storage.ledgercli.Ledger method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
</tr></table>
|
||||
|
||||
|
@ -400,13 +396,13 @@
|
|||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.gtkclient.AccountingApplication.load_ui">load_ui() (accounting.gtkclient.AccountingApplication method)</a>
|
||||
<dt><a href="api/accounting.html#accounting.exceptions.LedgerNotBalanced">LedgerNotBalanced</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="api/accounting.storage.html#accounting.storage.ledgercli.Ledger.locked_process">locked_process() (accounting.storage.ledgercli.Ledger method)</a>
|
||||
<dt><a href="api/accounting.html#accounting.gtkclient.AccountingApplication.load_ui">load_ui() (accounting.gtkclient.AccountingApplication method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
|
@ -460,16 +456,12 @@
|
|||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.gtkclient.AccountingApplication.on_transaction_new_activate">on_transaction_new_activate() (accounting.gtkclient.AccountingApplication method)</a>
|
||||
<dt><a href="api/accounting.html#accounting.gtkclient.AccountingApplication.on_transaction_refresh_activate">on_transaction_refresh_activate() (accounting.gtkclient.AccountingApplication method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.gtkclient.AccountingApplication.on_transaction_refresh_activate">on_transaction_refresh_activate() (accounting.gtkclient.AccountingApplication method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.gtkclient.AccountingApplication.on_transaction_view_cursor_changed">on_transaction_view_cursor_changed() (accounting.gtkclient.AccountingApplication method)</a>
|
||||
</dt>
|
||||
|
||||
|
@ -518,10 +510,6 @@
|
|||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="api/accounting.storage.html#accounting.storage.ledgercli.Ledger.read_until_prompt">read_until_prompt() (accounting.storage.ledgercli.Ledger method)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.storage.html#accounting.storage.ledgercli.Ledger.reg">reg() (accounting.storage.ledgercli.Ledger method)</a>
|
||||
</dt>
|
||||
|
||||
|
@ -591,6 +579,10 @@
|
|||
<dt><a href="api/accounting.html#accounting.web.transaction_get">transaction_get() (in module accounting.web)</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.web.transaction_get_all">transaction_get_all() (in module accounting.web)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
|
@ -610,6 +602,10 @@
|
|||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.exceptions.TransactionIDCollision">TransactionIDCollision</a>
|
||||
</dt>
|
||||
|
||||
|
||||
<dt><a href="api/accounting.html#accounting.exceptions.TransactionNotFound">TransactionNotFound</a>
|
||||
</dt>
|
||||
|
||||
|
|
10
doc/build/html/http-routingtable.html
vendored
10
doc/build/html/http-routingtable.html
vendored
|
@ -87,6 +87,16 @@
|
|||
<td>
|
||||
<a href="restapi.html#delete--transaction--string-transaction_id-"><tt class="xref">DELETE /transaction/<string:transaction_id></tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="restapi.html#get--transaction--string-transaction_id-"><tt class="xref">GET /transaction/<string:transaction_id></tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="restapi.html#post--transaction--string-transaction_id-"><tt class="xref">POST /transaction/<string:transaction_id></tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
|
4
doc/build/html/index.html
vendored
4
doc/build/html/index.html
vendored
|
@ -74,9 +74,11 @@
|
|||
</ul>
|
||||
</li>
|
||||
<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#get-all-transactions">Get all transactions</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="restapi.html#get-a-single-transaction">Get a single transaction</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>
|
||||
<li class="toctree-l2"><a class="reference internal" href="restapi.html#update-a-transaction">Update a transaction</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
BIN
doc/build/html/objects.inv
vendored
BIN
doc/build/html/objects.inv
vendored
Binary file not shown.
124
doc/build/html/restapi.html
vendored
124
doc/build/html/restapi.html
vendored
|
@ -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 class="right" >
|
||||
<a href="README.html" title="accounting-api README"
|
||||
accesskey="P">previous</a> |</li>
|
||||
|
@ -63,13 +63,12 @@
|
|||
<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>
|
||||
<div class="section" id="get-all-transactions">
|
||||
<h2>Get all transactions<a class="headerlink" href="#get-all-transactions" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="get">
|
||||
<dt id="get--transaction">
|
||||
<tt class="descname">GET </tt><tt class="descname">/transaction</tt><a class="headerlink" href="#get--transaction" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get all transactions</p>
|
||||
<p><strong>Example request</strong></p>
|
||||
<dd><p><strong>Example request</strong></p>
|
||||
<div class="highlight-http"><div class="highlight"><pre><span class="nf">GET</span> <span class="nn">/transaction</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
||||
<span class="na">Host</span><span class="o">:</span> <span class="l">accounting.example</span>
|
||||
<span class="na">Accept</span><span class="o">:</span> <span class="l">application/json</span>
|
||||
|
@ -149,6 +148,57 @@ accounting-api application provides.</p>
|
|||
</div>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="get-a-single-transaction">
|
||||
<h2>Get a single transaction<a class="headerlink" href="#get-a-single-transaction" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="get">
|
||||
<dt id="get--transaction--string-transaction_id-">
|
||||
<tt class="descname">GET </tt><tt class="descname">/transaction/<string:transaction_id></tt><a class="headerlink" href="#get--transaction--string-transaction_id-" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><strong>Example request</strong></p>
|
||||
<div class="highlight-http"><div class="highlight"><pre><span class="nf">GET</span> <span class="nn">/transaction/2aeea63b-0996-4ead-bc4c-e15505dff226</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
||||
<span class="na">Host</span><span class="o">:</span> <span class="l">accounting.example</span>
|
||||
<span class="na">Accept</span><span class="o">:</span> <span class="l">application/json</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p><strong>Example response</strong></p>
|
||||
<div class="highlight-http"><div class="highlight"><pre><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.0</span> <span class="m">200</span> <span class="ne">OK</span>
|
||||
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
||||
|
||||
<span class="p">{</span>
|
||||
<span class="nt">"transaction"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Transaction"</span><span class="p">,</span>
|
||||
<span class="nt">"date"</span><span class="p">:</span> <span class="s2">"2013-12-26"</span><span class="p">,</span>
|
||||
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"2aeea63b-0996-4ead-bc4c-e15505dff226"</span><span class="p">,</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{},</span>
|
||||
<span class="nt">"payee"</span><span class="p">:</span> <span class="s2">"January Rent"</span><span class="p">,</span>
|
||||
<span class="nt">"postings"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Posting"</span><span class="p">,</span>
|
||||
<span class="nt">"account"</span><span class="p">:</span> <span class="s2">"Assets:Checking"</span><span class="p">,</span>
|
||||
<span class="nt">"amount"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Amount"</span><span class="p">,</span>
|
||||
<span class="nt">"amount"</span><span class="p">:</span> <span class="s2">"-424.24"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"USD"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{}</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Posting"</span><span class="p">,</span>
|
||||
<span class="nt">"account"</span><span class="p">:</span> <span class="s2">"Expenses:Rent"</span><span class="p">,</span>
|
||||
<span class="nt">"amount"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Amount"</span><span class="p">,</span>
|
||||
<span class="nt">"amount"</span><span class="p">:</span> <span class="s2">"424.24"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"USD"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="add-transactions">
|
||||
<h2>Add transactions<a class="headerlink" href="#add-transactions" title="Permalink to this headline">¶</a></h2>
|
||||
|
@ -248,6 +298,62 @@ accounting-api application provides.</p>
|
|||
</div>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="update-a-transaction">
|
||||
<h2>Update a transaction<a class="headerlink" href="#update-a-transaction" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="post">
|
||||
<dt id="post--transaction--string-transaction_id-">
|
||||
<tt class="descname">POST </tt><tt class="descname">/transaction/<string:transaction_id></tt><a class="headerlink" href="#post--transaction--string-transaction_id-" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><strong>Example request</strong></p>
|
||||
<div class="highlight-http"><div class="highlight"><pre><span class="nf">POST</span> <span class="nn">/transaction/2aeea63b-0996-4ead-bc4c-e15505dff226</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
||||
<span class="na">Host</span><span class="o">:</span> <span class="l">accounting.example</span>
|
||||
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
||||
<span class="na">Accept</span><span class="o">:</span> <span class="l">application/json</span>
|
||||
|
||||
<span class="p">{</span>
|
||||
<span class="nt">"transaction"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Transaction"</span><span class="p">,</span>
|
||||
<span class="nt">"date"</span><span class="p">:</span> <span class="s2">"2013-12-26"</span><span class="p">,</span>
|
||||
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"2aeea63b-0996-4ead-bc4c-e15505dff226"</span><span class="p">,</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{},</span>
|
||||
<span class="nt">"payee"</span><span class="p">:</span> <span class="s2">"February Rent"</span><span class="p">,</span>
|
||||
<span class="nt">"postings"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Posting"</span><span class="p">,</span>
|
||||
<span class="nt">"account"</span><span class="p">:</span> <span class="s2">"Assets:Checking"</span><span class="p">,</span>
|
||||
<span class="nt">"amount"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Amount"</span><span class="p">,</span>
|
||||
<span class="nt">"amount"</span><span class="p">:</span> <span class="s2">"-424.24"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"USD"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{}</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Posting"</span><span class="p">,</span>
|
||||
<span class="nt">"account"</span><span class="p">:</span> <span class="s2">"Expenses:Rent"</span><span class="p">,</span>
|
||||
<span class="nt">"amount"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"__type__"</span><span class="p">:</span> <span class="s2">"Amount"</span><span class="p">,</span>
|
||||
<span class="nt">"amount"</span><span class="p">:</span> <span class="s2">"424.24"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"USD"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p><strong>Example response</strong></p>
|
||||
<div class="highlight-http"><div class="highlight"><pre><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.0</span> <span class="m">200</span> <span class="ne">OK</span>
|
||||
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
||||
|
||||
<span class="p">{</span>
|
||||
<span class="nt">"status"</span><span class="p">:</span> <span class="s2">"OK"</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -263,9 +369,11 @@ accounting-api application provides.</p>
|
|||
<h3><a href="index.html">Table Of Contents</a></h3>
|
||||
<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="#get-all-transactions">Get all transactions</a></li>
|
||||
<li><a class="reference internal" href="#get-a-single-transaction">Get a single transaction</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>
|
||||
<li><a class="reference internal" href="#update-a-transaction">Update a transaction</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
2
doc/build/html/searchindex.js
vendored
2
doc/build/html/searchindex.js
vendored
File diff suppressed because one or more lines are too long
|
@ -6,13 +6,11 @@ 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
|
||||
Get all transactions
|
||||
----------------
|
||||
|
||||
.. http:get:: /transaction
|
||||
|
||||
Get all transactions
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
@ -96,6 +94,59 @@ Get transactions
|
|||
]
|
||||
}
|
||||
|
||||
|
||||
Get a single transaction
|
||||
------------------------
|
||||
|
||||
.. http:get:: /transaction/<string:transaction_id>
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
GET /transaction/2aeea63b-0996-4ead-bc4c-e15505dff226 HTTP/1.1
|
||||
Host: accounting.example
|
||||
Accept: application/json
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.0 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"transaction": {
|
||||
"__type__": "Transaction",
|
||||
"date": "2013-12-26",
|
||||
"id": "2aeea63b-0996-4ead-bc4c-e15505dff226",
|
||||
"metadata": {},
|
||||
"payee": "January Rent",
|
||||
"postings": [
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-424.24",
|
||||
"symbol": "USD"
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Expenses:Rent",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "424.24",
|
||||
"symbol": "USD"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Add transactions
|
||||
----------------
|
||||
|
||||
|
@ -188,3 +239,61 @@ Delete a transaction
|
|||
{
|
||||
"status": "OK"
|
||||
}
|
||||
|
||||
|
||||
Update a transaction
|
||||
--------------------
|
||||
|
||||
.. http:post:: /transaction/<string:transaction_id>
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
POST /transaction/2aeea63b-0996-4ead-bc4c-e15505dff226 HTTP/1.1
|
||||
Host: accounting.example
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"transaction": {
|
||||
"__type__": "Transaction",
|
||||
"date": "2013-12-26",
|
||||
"id": "2aeea63b-0996-4ead-bc4c-e15505dff226",
|
||||
"metadata": {},
|
||||
"payee": "February Rent",
|
||||
"postings": [
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-424.24",
|
||||
"symbol": "USD"
|
||||
},
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Expenses:Rent",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "424.24",
|
||||
"symbol": "USD"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.0 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"status": "OK"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue