[doc] Added REST API, using sphinxcontrib-httpdomain
This commit is contained in:
parent
8776ab1ff8
commit
3378805b80
31 changed files with 977 additions and 12 deletions
16
doc/build/html/README.html
vendored
16
doc/build/html/README.html
vendored
|
@ -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="next" title="accounting package" href="api/accounting.html" />
|
||||
<link rel="next" title="REST API" href="restapi.html" />
|
||||
<link rel="prev" title="Welcome to Accounting API’s documentation!" href="index.html" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -38,7 +38,10 @@
|
|||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="api/accounting.html" title="accounting package"
|
||||
<a href="http-routingtable.html" title="HTTP Routing Table"
|
||||
>routing table</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="restapi.html" title="REST API"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="index.html" title="Welcome to Accounting API’s documentation!"
|
||||
|
@ -154,8 +157,8 @@ sudo apt-get install ledger
|
|||
<p class="topless"><a href="index.html"
|
||||
title="previous chapter">Welcome to Accounting API’s documentation!</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="api/accounting.html"
|
||||
title="next chapter">accounting package</a></p>
|
||||
<p class="topless"><a href="restapi.html"
|
||||
title="next chapter">REST API</a></p>
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="_sources/README.txt"
|
||||
|
@ -188,7 +191,10 @@ sudo apt-get install ledger
|
|||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="api/accounting.html" title="accounting package"
|
||||
<a href="http-routingtable.html" title="HTTP Routing Table"
|
||||
>routing table</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="restapi.html" title="REST API"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="index.html" title="Welcome to Accounting API’s documentation!"
|
||||
|
|
6
doc/build/html/_modules/accounting.html
vendored
6
doc/build/html/_modules/accounting.html
vendored
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -397,6 +400,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -209,6 +212,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -98,6 +101,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -84,6 +87,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -225,6 +228,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -133,6 +136,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -96,6 +99,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -412,6 +415,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -163,6 +166,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -133,6 +136,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -139,6 +142,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
6
doc/build/html/_modules/accounting/web.html
vendored
6
doc/build/html/_modules/accounting/web.html
vendored
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -276,6 +279,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
6
doc/build/html/_modules/index.html
vendored
6
doc/build/html/_modules/index.html
vendored
|
@ -32,6 +32,9 @@
|
|||
<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>
|
||||
|
@ -87,6 +90,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
1
doc/build/html/_sources/index.txt
vendored
1
doc/build/html/_sources/index.txt
vendored
|
@ -12,6 +12,7 @@ Contents:
|
|||
:maxdepth: 2
|
||||
|
||||
README
|
||||
restapi
|
||||
api/accounting.rst
|
||||
|
||||
|
||||
|
|
186
doc/build/html/_sources/restapi.txt
vendored
Normal file
186
doc/build/html/_sources/restapi.txt
vendored
Normal file
|
@ -0,0 +1,186 @@
|
|||
==========
|
||||
REST API
|
||||
==========
|
||||
|
||||
Get transactions
|
||||
----------------
|
||||
|
||||
.. http:get:: /transaction
|
||||
|
||||
Get all transactions
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
GET /transaction HTTP/1.1
|
||||
Host: accounting.example
|
||||
Accept: application/json
|
||||
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"transactions": [
|
||||
{
|
||||
"__type__": "Transaction",
|
||||
"date": "2010-01-01",
|
||||
"id": "Ids can be anything",
|
||||
"metadata": {},
|
||||
"payee": "Kindly T. Donor",
|
||||
"postings": [
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Income:Foo:Donation",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-100",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {
|
||||
"Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "100",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"__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",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-400",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {
|
||||
"Approval": "Projects/Foo/earmark-record.txt"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "400",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
Add transactions
|
||||
----------------
|
||||
|
||||
.. http:post:: /transaction
|
||||
|
||||
:jsonparam array transactions: A list of Transaction objects to add.
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
POST /transaction HTTP/1.1
|
||||
Host: accounting.example
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"transactions": [
|
||||
{
|
||||
"__type__": "Transaction",
|
||||
"date": "2010-01-01",
|
||||
"id": "Ids can be anything",
|
||||
"metadata": {},
|
||||
"payee": "Kindly T. Donor",
|
||||
"postings": [
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Income:Foo:Donation",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-100",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {
|
||||
"Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "100",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"status": "OK",
|
||||
"transaction_ids": [
|
||||
"Ids can be anything"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Delete a transaction
|
||||
--------------------
|
||||
|
||||
.. http:delete:: /transaction/<string:transaction_id>
|
||||
|
||||
Delete the transaction with ID :data:`transaction_id`.
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
DELETE /transaction/123456 HTTP/1.1
|
||||
Host: accounting.example
|
||||
Accept: application/json
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"status": "OK"
|
||||
}
|
16
doc/build/html/api/accounting.html
vendored
16
doc/build/html/api/accounting.html
vendored
|
@ -25,7 +25,7 @@
|
|||
<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="accounting.storage package" href="accounting.storage.html" />
|
||||
<link rel="prev" title="The Accounting API" href="../README.html" />
|
||||
<link rel="prev" title="REST API" href="../restapi.html" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
|
@ -37,11 +37,14 @@
|
|||
<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="accounting.storage.html" title="accounting.storage package"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="../README.html" title="The Accounting API"
|
||||
<a href="../restapi.html" title="REST API"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="../index.html">Accounting API 0.1-beta documentation</a> »</li>
|
||||
</ul>
|
||||
|
@ -378,8 +381,8 @@ the ledger file.</p>
|
|||
</ul>
|
||||
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="../README.html"
|
||||
title="previous chapter">The Accounting API</a></p>
|
||||
<p class="topless"><a href="../restapi.html"
|
||||
title="previous chapter">REST API</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="accounting.storage.html"
|
||||
title="next chapter">accounting.storage package</a></p>
|
||||
|
@ -414,11 +417,14 @@ the ledger file.</p>
|
|||
<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="accounting.storage.html" title="accounting.storage package"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="../README.html" title="The Accounting API"
|
||||
<a href="../restapi.html" title="REST API"
|
||||
>previous</a> |</li>
|
||||
<li><a href="../index.html">Accounting API 0.1-beta documentation</a> »</li>
|
||||
</ul>
|
||||
|
|
6
doc/build/html/api/accounting.storage.html
vendored
6
doc/build/html/api/accounting.storage.html
vendored
|
@ -38,6 +38,9 @@
|
|||
<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="accounting.storage.sql.html" title="accounting.storage.sql package"
|
||||
accesskey="N">next</a> |</li>
|
||||
|
@ -309,6 +312,9 @@ the old transaction using <tt class="xref py py-data docutils literal"><span cla
|
|||
<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="accounting.storage.sql.html" title="accounting.storage.sql package"
|
||||
>next</a> |</li>
|
||||
|
|
|
@ -37,6 +37,9 @@
|
|||
<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="accounting.storage.html" title="accounting.storage package"
|
||||
accesskey="P">previous</a> |</li>
|
||||
|
@ -243,6 +246,9 @@
|
|||
<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="accounting.storage.html" title="accounting.storage package"
|
||||
>previous</a> |</li>
|
||||
|
|
6
doc/build/html/api/modules.html
vendored
6
doc/build/html/api/modules.html
vendored
|
@ -35,6 +35,9 @@
|
|||
<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>
|
||||
|
@ -112,6 +115,9 @@
|
|||
<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>
|
||||
|
|
6
doc/build/html/genindex.html
vendored
6
doc/build/html/genindex.html
vendored
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -639,6 +642,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="#" title="General Index"
|
||||
>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>
|
||||
|
|
128
doc/build/html/http-routingtable.html
vendored
Normal file
128
doc/build/html/http-routingtable.html
vendored
Normal file
|
@ -0,0 +1,128 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>HTTP Routing Table — Accounting API 0.1-beta documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/pydoctheme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: './',
|
||||
VERSION: '0.1-beta',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Accounting API 0.1-beta documentation" href="index.html" />
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="#" title="HTTP Routing Table"
|
||||
>routing table</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li><a href="index.html">Accounting API 0.1-beta documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body">
|
||||
|
||||
|
||||
<h1>HTTP Routing Table</h1>
|
||||
|
||||
<div class="modindex-jumpbox">
|
||||
<a href="#cap-/transaction"><strong>/transaction</strong></a>
|
||||
</div>
|
||||
|
||||
<table class="indextable modindextable" cellspacing="0" cellpadding="2">
|
||||
<tr class="pcap"><td></td><td> </td><td></td></tr>
|
||||
<tr class="cap" id="cap-/transaction"><td></td><td>
|
||||
<strong>/transaction</strong></td><td></td></tr>
|
||||
<tr>
|
||||
<td></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#post--transaction"><tt class="xref">POST /transaction</tt></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<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>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none">
|
||||
<h3>Quick search</h3>
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" />
|
||||
<input type="submit" value="Go" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
<p class="searchtip" style="font-size: 90%">
|
||||
Enter search terms or a module, class or function name.
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="genindex.html" title="General Index"
|
||||
>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><a href="index.html">Accounting API 0.1-beta documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2013, Joar Wandborg.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
12
doc/build/html/index.html
vendored
12
doc/build/html/index.html
vendored
|
@ -33,6 +33,9 @@
|
|||
<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>
|
||||
|
@ -59,6 +62,12 @@
|
|||
<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-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>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="api/accounting.html">accounting package</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/accounting.html#subpackages">Subpackages</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/accounting.html#submodules">Submodules</a></li>
|
||||
|
@ -130,6 +139,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
BIN
doc/build/html/objects.inv
vendored
BIN
doc/build/html/objects.inv
vendored
Binary file not shown.
6
doc/build/html/py-modindex.html
vendored
6
doc/build/html/py-modindex.html
vendored
|
@ -35,6 +35,9 @@
|
|||
<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>
|
||||
|
@ -155,6 +158,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
318
doc/build/html/restapi.html
vendored
Normal file
318
doc/build/html/restapi.html
vendored
Normal file
|
@ -0,0 +1,318 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>REST API — Accounting API 0.1-beta documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/pydoctheme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: './',
|
||||
VERSION: '0.1-beta',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Accounting API 0.1-beta documentation" href="index.html" />
|
||||
<link rel="next" title="accounting package" href="api/accounting.html" />
|
||||
<link rel="prev" title="The Accounting API" href="README.html" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="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="api/accounting.html" title="accounting package"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="README.html" title="The Accounting API"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li><a href="index.html">Accounting API 0.1-beta documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body">
|
||||
|
||||
<div class="section" id="rest-api">
|
||||
<h1>REST API<a class="headerlink" href="#rest-api" title="Permalink to this headline">¶</a></h1>
|
||||
<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">
|
||||
<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>
|
||||
<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>
|
||||
</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.1</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">"transactions"</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">"Transaction"</span><span class="p">,</span>
|
||||
<span class="nt">"date"</span><span class="p">:</span> <span class="s2">"2010-01-01"</span><span class="p">,</span>
|
||||
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"Ids can be anything"</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">"Kindly T. Donor"</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">"Income:Foo:Donation"</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">"-100"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"$"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Invoice"</span><span class="p">:</span> <span class="s2">"Projects/Foo/Invoices/Invoice20100101.pdf"</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">"100"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"$"</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>
|
||||
<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">"2011-03-15"</span><span class="p">,</span>
|
||||
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"but mind you if they collide."</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">"Another J. Donor"</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">"Income:Foo:Donation"</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">"-400"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"$"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Approval"</span><span class="p">:</span> <span class="s2">"Projects/Foo/earmark-record.txt"</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">"400"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"$"</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>
|
||||
<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>
|
||||
<dl class="post">
|
||||
<dt id="post--transaction">
|
||||
<tt class="descname">POST </tt><tt class="descname">/transaction</tt><a class="headerlink" href="#post--transaction" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field-odd field"><th class="field-name" colspan="2">Json Parameters:</th></tr>
|
||||
<tr class="field-odd field"><td> </td><td class="field-body"><ul class="first last simple">
|
||||
<li><strong>transactions</strong> (<em>array</em>) – A list of Transaction objects to add.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Example request</strong></p>
|
||||
<div class="highlight-http"><div class="highlight"><pre><span class="nf">POST</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">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">"transactions"</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">"Transaction"</span><span class="p">,</span>
|
||||
<span class="nt">"date"</span><span class="p">:</span> <span class="s2">"2010-01-01"</span><span class="p">,</span>
|
||||
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"Ids can be anything"</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">"Kindly T. Donor"</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">"Income:Foo:Donation"</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">"-100"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"$"</span>
|
||||
<span class="p">},</span>
|
||||
<span class="nt">"metadata"</span><span class="p">:</span> <span class="p">{</span>
|
||||
<span class="nt">"Invoice"</span><span class="p">:</span> <span class="s2">"Projects/Foo/Invoices/Invoice20100101.pdf"</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">"100"</span><span class="p">,</span>
|
||||
<span class="nt">"symbol"</span><span class="p">:</span> <span class="s2">"$"</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>
|
||||
<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.1</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>
|
||||
<span class="nt">"transaction_ids"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="s2">"Ids can be anything"</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="delete-a-transaction">
|
||||
<h2>Delete a transaction<a class="headerlink" href="#delete-a-transaction" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="delete">
|
||||
<dt id="delete--transaction--string-transaction_id-">
|
||||
<tt class="descname">DELETE </tt><tt class="descname">/transaction/<string:transaction_id></tt><a class="headerlink" href="#delete--transaction--string-transaction_id-" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Delete the transaction with ID <tt class="xref py py-data docutils literal"><span class="pre">transaction_id</span></tt>.</p>
|
||||
<p><strong>Example request</strong></p>
|
||||
<div class="highlight-http"><div class="highlight"><pre><span class="nf">DELETE</span> <span class="nn">/transaction/123456</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.1</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>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<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="#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>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="README.html"
|
||||
title="previous chapter">The Accounting API</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="api/accounting.html"
|
||||
title="next chapter">accounting package</a></p>
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="_sources/restapi.txt"
|
||||
rel="nofollow">Show Source</a></li>
|
||||
</ul>
|
||||
<div id="searchbox" style="display: none">
|
||||
<h3>Quick search</h3>
|
||||
<form class="search" action="search.html" method="get">
|
||||
<input type="text" name="q" />
|
||||
<input type="submit" value="Go" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
<p class="searchtip" style="font-size: 90%">
|
||||
Enter search terms or a module, class or function name.
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="genindex.html" title="General Index"
|
||||
>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="api/accounting.html" title="accounting package"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="README.html" title="The Accounting API"
|
||||
>previous</a> |</li>
|
||||
<li><a href="index.html">Accounting API 0.1-beta documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
© Copyright 2013, Joar Wandborg.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
6
doc/build/html/search.html
vendored
6
doc/build/html/search.html
vendored
|
@ -40,6 +40,9 @@
|
|||
<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>
|
||||
|
@ -91,6 +94,9 @@
|
|||
<li class="right" style="margin-right: 10px">
|
||||
<a href="genindex.html" title="General Index"
|
||||
>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>
|
||||
|
|
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
|
@ -25,7 +25,14 @@ sys.path.insert(0, os.path.abspath('../../'))
|
|||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinxcontrib.httpdomain'
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
|
|
@ -12,6 +12,7 @@ Contents:
|
|||
:maxdepth: 2
|
||||
|
||||
README
|
||||
restapi
|
||||
api/accounting.rst
|
||||
|
||||
|
||||
|
|
186
doc/source/restapi.rst
Normal file
186
doc/source/restapi.rst
Normal file
|
@ -0,0 +1,186 @@
|
|||
==========
|
||||
REST API
|
||||
==========
|
||||
|
||||
Get transactions
|
||||
----------------
|
||||
|
||||
.. http:get:: /transaction
|
||||
|
||||
Get all transactions
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
GET /transaction HTTP/1.1
|
||||
Host: accounting.example
|
||||
Accept: application/json
|
||||
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"transactions": [
|
||||
{
|
||||
"__type__": "Transaction",
|
||||
"date": "2010-01-01",
|
||||
"id": "Ids can be anything",
|
||||
"metadata": {},
|
||||
"payee": "Kindly T. Donor",
|
||||
"postings": [
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Income:Foo:Donation",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-100",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {
|
||||
"Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "100",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"__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",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-400",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {
|
||||
"Approval": "Projects/Foo/earmark-record.txt"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "400",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
Add transactions
|
||||
----------------
|
||||
|
||||
.. http:post:: /transaction
|
||||
|
||||
:jsonparam array transactions: A list of Transaction objects to add.
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
POST /transaction HTTP/1.1
|
||||
Host: accounting.example
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
|
||||
{
|
||||
"transactions": [
|
||||
{
|
||||
"__type__": "Transaction",
|
||||
"date": "2010-01-01",
|
||||
"id": "Ids can be anything",
|
||||
"metadata": {},
|
||||
"payee": "Kindly T. Donor",
|
||||
"postings": [
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Income:Foo:Donation",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "-100",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {
|
||||
"Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "Posting",
|
||||
"account": "Assets:Checking",
|
||||
"amount": {
|
||||
"__type__": "Amount",
|
||||
"amount": "100",
|
||||
"symbol": "$"
|
||||
},
|
||||
"metadata": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"status": "OK",
|
||||
"transaction_ids": [
|
||||
"Ids can be anything"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Delete a transaction
|
||||
--------------------
|
||||
|
||||
.. http:delete:: /transaction/<string:transaction_id>
|
||||
|
||||
Delete the transaction with ID :data:`transaction_id`.
|
||||
|
||||
**Example request**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
DELETE /transaction/123456 HTTP/1.1
|
||||
Host: accounting.example
|
||||
Accept: application/json
|
||||
|
||||
**Example response**
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"status": "OK"
|
||||
}
|
Loading…
Reference in a new issue