diff --git a/doc/build/html/README.html b/doc/build/html/README.html index 41ae220..ed7c0bf 100644 --- a/doc/build/html/README.html +++ b/doc/build/html/README.html @@ -6,7 +6,7 @@ - The Accounting API — Accounting API 0.1-beta documentation + accounting-api README — Accounting API 0.1-beta documentation @@ -24,8 +24,8 @@ - - + + @@ -48,10 +48,10 @@ modules |
  • - next |
  • - previous |
  • Accounting API 0.1-beta documentation »
  • @@ -62,8 +62,8 @@
    -
    -

    The Accounting API

    +
    +

    accounting-api README

    Dependencies

    +
    [docs]class TransactionNotFound(AccountingException): pass
    diff --git a/doc/build/html/_modules/accounting/gtkclient.html b/doc/build/html/_modules/accounting/gtkclient.html index b1a520a..1a103fc 100644 --- a/doc/build/html/_modules/accounting/gtkclient.html +++ b/doc/build/html/_modules/accounting/gtkclient.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • Module code »
  • diff --git a/doc/build/html/_modules/accounting/models.html b/doc/build/html/_modules/accounting/models.html index 16c4396..82fc095 100644 --- a/doc/build/html/_modules/accounting/models.html +++ b/doc/build/html/_modules/accounting/models.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • Module code »
  • @@ -60,14 +60,18 @@ # Part of accounting-api project: # https://gitorious.org/conservancy/accounting-api # License: AGPLv3-or-later - +import datetime import uuid + from decimal import Decimal
    [docs]class Transaction: def __init__(self, id=None, date=None, payee=None, postings=None, metadata=None, _generate_id=False): + if type(date) == datetime.datetime: + date = date.date() + self.id = id self.date = date self.payee = payee @@ -80,6 +84,9 @@
    [docs] def generate_id(self): self.id = str(uuid.uuid4())
    + def __eq__(self, other): + return self.__dict__ == other.__dict__ + def __repr__(self): return ('<{self.__class__.__name__} {self.id} {date}' + ' {self.payee} {self.postings}').format( @@ -93,6 +100,9 @@ self.amount = amount self.metadata = metadata if metadata is not None else {} + def __eq__(self, other): + return self.__dict__ == other.__dict__ + def __repr__(self): return ('<{self.__class__.__name__} "{self.account}"' + ' {self.amount}>').format(self=self) @@ -103,6 +113,9 @@ self.amount = Decimal(amount) self.symbol = symbol + def __eq__(self, other): + return self.__dict__ == other.__dict__ + def __repr__(self): return ('<{self.__class__.__name__} {self.symbol}' + ' {self.amount}>').format(self=self) @@ -114,6 +127,9 @@ self.amounts = amounts self.accounts = accounts + def __eq__(self, other): + return self.__dict__ == other.__dict__ + def __repr__(self): return ('<{self.__class__.__name__} "{self.name}" {self.amounts}' + ' {self.accounts}>').format(self=self)
    diff --git a/doc/build/html/_modules/accounting/storage.html b/doc/build/html/_modules/accounting/storage.html index fdca483..9d2922a 100644 --- a/doc/build/html/_modules/accounting/storage.html +++ b/doc/build/html/_modules/accounting/storage.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • Module code »
  • @@ -63,8 +63,6 @@ from abc import ABCMeta, abstractmethod -from accounting.exceptions import AccountingException -
    [docs]class Storage: ''' @@ -105,11 +103,7 @@
    @abstractmethod
    [docs] def reverse_transaction(self, transaction_id): - raise NotImplementedError - -
    -
    [docs]class TransactionNotFound(AccountingException): - pass
    + raise NotImplementedError
    diff --git a/doc/build/html/_modules/accounting/storage/ledgercli.html b/doc/build/html/_modules/accounting/storage/ledgercli.html index 01e9fb3..f60f2e6 100644 --- a/doc/build/html/_modules/accounting/storage/ledgercli.html +++ b/doc/build/html/_modules/accounting/storage/ledgercli.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • Module code »
  • accounting.storage »
  • @@ -72,9 +72,9 @@ from xml.etree import ElementTree from contextlib import contextmanager -from accounting.exceptions import AccountingException +from accounting.exceptions import AccountingException, TransactionNotFound from accounting.models import Account, Transaction, Posting, Amount -from accounting.storage import Storage, TransactionNotFound +from accounting.storage import Storage _log = logging.getLogger(__name__) @@ -189,6 +189,10 @@ while True: line = process.stdout.read(1) # XXX: This is a hack + if len(line) > 0: + pass + #_log.debug('line: %s', line) + output += line if b'\n] ' in output: @@ -208,6 +212,8 @@ if isinstance(command, str): command = command.encode('utf8') + _log.debug('Sending command: %r', command) + p.stdin.write(command + b'\n') p.stdin.flush() @@ -265,6 +271,8 @@ with open(self.ledger_file, 'ab') as f: f.write(output) + _log.info('Added transaction %s', transaction.id) + _log.debug('written to file: %s', output) return transaction.id @@ -323,8 +331,8 @@ if transaction.id == transaction_id: return transaction - raise TransactionNotFound('No transaction with id %s found', - transaction_id) + raise TransactionNotFound( + 'No transaction with id {0} found'.format(transaction_id))
    [docs] def reg(self): output = self.send_command('xml') @@ -473,6 +481,11 @@ # Delete the preceding line to make the file del_start -= 1 + _log.info('Removing transaction with ID: %s (lines %d-%d)', + transaction_id, + del_start, + semantic_lines['next_transaction_or_eof']) + del lines[del_start:semantic_lines['next_transaction_or_eof']] with open(self.ledger_file, 'w') as f: @@ -498,6 +511,7 @@ self.add_transaction(transaction) + _log.info('Updated transaction %s', transaction.id) _log.debug('Updated transaction from: %s to: %s', old_transaction, transaction) diff --git a/doc/build/html/_modules/accounting/storage/sql.html b/doc/build/html/_modules/accounting/storage/sql.html index 21e8305..a66967e 100644 --- a/doc/build/html/_modules/accounting/storage/sql.html +++ b/doc/build/html/_modules/accounting/storage/sql.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • Module code »
  • accounting.storage »
  • diff --git a/doc/build/html/_modules/accounting/storage/sql/models.html b/doc/build/html/_modules/accounting/storage/sql/models.html index c0d6a08..9c2d1e3 100644 --- a/doc/build/html/_modules/accounting/storage/sql/models.html +++ b/doc/build/html/_modules/accounting/storage/sql/models.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • Module code »
  • accounting.storage »
  • diff --git a/doc/build/html/_modules/accounting/transport.html b/doc/build/html/_modules/accounting/transport.html index ccbb577..672039a 100644 --- a/doc/build/html/_modules/accounting/transport.html +++ b/doc/build/html/_modules/accounting/transport.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • Module code »
  • @@ -65,6 +65,7 @@ from flask import json +from accounting.exceptions import AccountingException from accounting.models import Amount, Transaction, Posting, Account @@ -99,10 +100,10 @@ amount=str(o.amount), symbol=o.symbol ) - elif isinstance(o, Exception): + elif isinstance(o, AccountingException): return dict( - __type__=o.__class__.__name__, - args=o.args + type=o.__class__.__name__, + message=o.message ) return json.JSONEncoder.default(self, o) @@ -117,7 +118,7 @@ return d types = {c.__name__: c for c in [Amount, Transaction, Posting, - Account]} + Account, AccountingException]} _type = d.pop('__type__') diff --git a/doc/build/html/_modules/accounting/web.html b/doc/build/html/_modules/accounting/web.html index d2ca1a1..b9e09bd 100644 --- a/doc/build/html/_modules/accounting/web.html +++ b/doc/build/html/_modules/accounting/web.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • Module code »
  • @@ -69,7 +69,7 @@ import logging import argparse -from flask import Flask, jsonify, request, render_template +from flask import Flask, jsonify, request, render_template, abort from flask.ext.script import Manager from flask.ext.migrate import Migrate, MigrateCommand @@ -78,32 +78,18 @@ from accounting.storage.ledgercli import Ledger from accounting.storage.sql import SQLStorage from accounting.transport import AccountingEncoder, AccountingDecoder -from accounting.exceptions import AccountingException +from accounting.exceptions import AccountingException, TransactionNotFound from accounting.decorators import jsonify_exceptions, cors app = Flask('accounting') app.config.from_pyfile('config.py') -storage = Storage() - -if isinstance(storage, SQLStorage): - # TODO: Move migration stuff into SQLStorage - db = storage.db - migrate = Migrate(app, db) - - manager = Manager(app) - manager.add_command('db', MigrateCommand) +app.ledger = Storage() -@app.before_request
    [docs]def init_ledger(): - ''' - :py:meth:`flask.Flask.before_request`-decorated method that initializes an - :py:class:`accounting.Ledger` object. - ''' - global ledger - #ledger = Ledger(ledger_file=app.config['LEDGER_FILE']) + app.ledger = Ledger(app) # These will convert output from our internal classes to JSON and back
    @@ -144,9 +130,12 @@ Returns the JSON-serialized output of :meth:`accounting.Ledger.reg` ''' if transaction_id is None: - return jsonify(transactions=storage.get_transactions()) + return jsonify(transactions=app.ledger.get_transactions()) - return jsonify(transaction=storage.get_transaction(transaction_id)) + try: + return jsonify(transaction=app.ledger.get_transaction(transaction_id)) + except TransactionNotFound: + abort(404)
    @app.route('/transaction/<string:transaction_id>', methods=['POST']) @@ -164,7 +153,7 @@ elif transaction.id is None: transaction.id = transaction_id - storage.update_transaction(transaction) + app.ledger.update_transaction(transaction) return jsonify(status='OK') @@ -176,7 +165,7 @@ if transaction_id is None: raise AccountingException('Transaction ID cannot be None') - storage.delete_transaction(transaction_id) + app.ledger.delete_transaction(transaction_id) return jsonify(status='OK') @@ -243,7 +232,7 @@ transaction_ids = [] for transaction in transactions: - transaction_ids.append(storage.add_transaction(transaction)) + transaction_ids.append(app.ledger.add_transaction(transaction)) return jsonify(status='OK', transaction_ids=transaction_ids) @@ -260,8 +249,7 @@ help=('Filter logging output. Possible values:' + ' CRITICAL, ERROR, WARNING, INFO, DEBUG')) - global storage - storage = Ledger(app=app) + init_ledger() args = parser.parse_args(argv) diff --git a/doc/build/html/_modules/index.html b/doc/build/html/_modules/index.html index c48d141..fc7ac12 100644 --- a/doc/build/html/_modules/index.html +++ b/doc/build/html/_modules/index.html @@ -39,12 +39,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • diff --git a/doc/build/html/_sources/README.txt b/doc/build/html/_sources/README.txt index bac2787..28e0464 100644 --- a/doc/build/html/_sources/README.txt +++ b/doc/build/html/_sources/README.txt @@ -1,8 +1,8 @@ -.. vim: textwith=80 +.. vim: textwidth=80 -==================== - The Accounting API -==================== +======================= + accounting-api README +======================= -------------- Dependencies diff --git a/doc/build/html/_sources/index.txt b/doc/build/html/_sources/index.txt index 6e32d15..864fa43 100644 --- a/doc/build/html/_sources/index.txt +++ b/doc/build/html/_sources/index.txt @@ -1,10 +1,6 @@ -.. Accounting API documentation master file, created by - sphinx-quickstart on Thu Dec 12 14:02:01 2013. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to Accounting API's documentation! -========================================== +======= + Index +======= ----------------------- Accounting API diff --git a/doc/build/html/_sources/restapi.txt b/doc/build/html/_sources/restapi.txt index 42b7998..1e3e1ae 100644 --- a/doc/build/html/_sources/restapi.txt +++ b/doc/build/html/_sources/restapi.txt @@ -1,6 +1,10 @@ -========== - REST API -========== +======================== + REST API Documentation +======================== + +The accounting-api projects main application provides a REST API for accounting +data. This is the documentation for the various REST endpoints that the +accounting-api application provides. Get transactions ---------------- @@ -28,63 +32,63 @@ Get transactions { "transactions": [ { - "__type__": "Transaction", - "date": "2010-01-01", - "id": "Ids can be anything", - "metadata": {}, - "payee": "Kindly T. Donor", + "__type__": "Transaction", + "date": "2010-01-01", + "id": "Ids can be anything", + "metadata": {}, + "payee": "Kindly T. Donor", "postings": [ { - "__type__": "Posting", - "account": "Income:Foo:Donation", + "__type__": "Posting", + "account": "Income:Foo:Donation", "amount": { - "__type__": "Amount", - "amount": "-100", + "__type__": "Amount", + "amount": "-100", "symbol": "$" - }, + }, "metadata": { "Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf" } - }, + }, { - "__type__": "Posting", - "account": "Assets:Checking", + "__type__": "Posting", + "account": "Assets:Checking", "amount": { - "__type__": "Amount", - "amount": "100", + "__type__": "Amount", + "amount": "100", "symbol": "$" - }, + }, "metadata": {} } ] - }, + }, { - "__type__": "Transaction", - "date": "2011-03-15", - "id": "but mind you if they collide.", - "metadata": {}, - "payee": "Another J. Donor", + "__type__": "Transaction", + "date": "2011-03-15", + "id": "but mind you if they collide.", + "metadata": {}, + "payee": "Another J. Donor", "postings": [ { - "__type__": "Posting", - "account": "Income:Foo:Donation", + "__type__": "Posting", + "account": "Income:Foo:Donation", "amount": { - "__type__": "Amount", - "amount": "-400", + "__type__": "Amount", + "amount": "-400", "symbol": "$" - }, + }, "metadata": { "Approval": "Projects/Foo/earmark-record.txt" } - }, + }, { - "__type__": "Posting", - "account": "Assets:Checking", + "__type__": "Posting", + "account": "Assets:Checking", "amount": { - "__type__": "Amount", - "amount": "400", + "__type__": "Amount", + "amount": "400", "symbol": "$" - }, + }, "metadata": {} } ] @@ -111,36 +115,36 @@ Add transactions { "transactions": [ { - "__type__": "Transaction", - "date": "2010-01-01", - "id": "Ids can be anything", - "metadata": {}, - "payee": "Kindly T. Donor", + "__type__": "Transaction", + "date": "2010-01-01", + "id": "Ids can be anything", + "metadata": {}, + "payee": "Kindly T. Donor", "postings": [ { - "__type__": "Posting", - "account": "Income:Foo:Donation", + "__type__": "Posting", + "account": "Income:Foo:Donation", "amount": { - "__type__": "Amount", - "amount": "-100", + "__type__": "Amount", + "amount": "-100", "symbol": "$" - }, + }, "metadata": { "Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf" } - }, + }, { - "__type__": "Posting", - "account": "Assets:Checking", + "__type__": "Posting", + "account": "Assets:Checking", "amount": { - "__type__": "Amount", - "amount": "100", + "__type__": "Amount", + "amount": "100", "symbol": "$" - }, + }, "metadata": {} } ] - }, + }, ] } diff --git a/doc/build/html/_static/accounting-api-logo.svg b/doc/build/html/_static/accounting-api-logo.svg index 22433b0..ac0cbf2 100644 --- a/doc/build/html/_static/accounting-api-logo.svg +++ b/doc/build/html/_static/accounting-api-logo.svg @@ -7,10 +7,18 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="167.00000pt" + id="svg951" + inkscape:version="0.48.4 r9939" + sodipodi:docname="accounting-api-logo.svg" + sodipodi:version="0.32" + width="300.00000pt" version="1.1" - width="300pt" - height="167pt" - id="svg951"> + inkscape:export-filename="/home/joar/git/accounting-api/doc/source/_static/accounting-api-logo.png" + inkscape:export-xdpi="49.176128" + inkscape:export-ydpi="49.176128"> @@ -63,28 +71,50 @@ + + id="g2198" + transform="translate(-256.9943,-227.9440)"> + 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" /> + 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" /> + 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" /> + 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" /> diff --git a/doc/build/html/api/accounting.html b/doc/build/html/api/accounting.html index 97fbfea..b068a4c 100644 --- a/doc/build/html/api/accounting.html +++ b/doc/build/html/api/accounting.html @@ -189,12 +189,18 @@ exceptions which are returned to the client as JSON.

    accounting.exceptions module

    -exception accounting.exceptions.AccountingException[source]
    +exception accounting.exceptions.AccountingException(message, **kw)[source]

    Bases: builtins.Exception

    Used as a base for exceptions that are returned to the caller via the jsonify_exceptions decorator

    +
    +
    +exception accounting.exceptions.TransactionNotFound(message, **kw)[source]
    +

    Bases: accounting.exceptions.AccountingException

    +
    +

    accounting.gtkclient module

    @@ -330,9 +336,7 @@ and the Flask endpoints.

    accounting.web.init_ledger()[source]
    -

    flask.Flask.before_request()-decorated method that initializes an -accounting.Ledger object.

    -
    +
    diff --git a/doc/build/html/api/accounting.storage.html b/doc/build/html/api/accounting.storage.html index 3714cae..64f95fc 100644 --- a/doc/build/html/api/accounting.storage.html +++ b/doc/build/html/api/accounting.storage.html @@ -244,12 +244,6 @@ the old transaction using
    -
    -
    -exception accounting.storage.TransactionNotFound[source]
    -

    Bases: accounting.exceptions.AccountingException

    -
    -
    diff --git a/doc/build/html/genindex.html b/doc/build/html/genindex.html index 811750d..2933cce 100644 --- a/doc/build/html/genindex.html +++ b/doc/build/html/genindex.html @@ -40,12 +40,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • @@ -610,7 +610,7 @@ -
    TransactionNotFound +
    TransactionNotFound
    diff --git a/doc/build/html/http-routingtable.html b/doc/build/html/http-routingtable.html index 057fa48..8e46989 100644 --- a/doc/build/html/http-routingtable.html +++ b/doc/build/html/http-routingtable.html @@ -46,12 +46,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • @@ -75,12 +75,12 @@ - POST /transaction + GET /transaction - GET /transaction + POST /transaction diff --git a/doc/build/html/index.html b/doc/build/html/index.html index df11ea7..dee0c71 100644 --- a/doc/build/html/index.html +++ b/doc/build/html/index.html @@ -6,7 +6,7 @@ - Welcome to Accounting API’s documentation! — Accounting API 0.1-beta documentation + Index — Accounting API 0.1-beta documentation @@ -24,7 +24,7 @@ - + @@ -42,14 +42,14 @@
  • index
  • -
  • - routing table |
  • modules |
  • - routing table |
  • +
  • + next |
  • Accounting API 0.1-beta documentation »
  • @@ -60,20 +60,20 @@
    -
    -

    Welcome to Accounting API’s documentation!

    +
    -

    Indices and tables

    +

    Indices and tables

    +
    +
    @@ -103,18 +103,18 @@

    Table Of Contents

    + +

    Related Topics

    This Page

    diff --git a/doc/build/html/objects.inv b/doc/build/html/objects.inv index e09b75a..50e52fe 100644 Binary files a/doc/build/html/objects.inv and b/doc/build/html/objects.inv differ diff --git a/doc/build/html/py-modindex.html b/doc/build/html/py-modindex.html index 8404219..85aadc6 100644 --- a/doc/build/html/py-modindex.html +++ b/doc/build/html/py-modindex.html @@ -42,12 +42,12 @@
  • index
  • -
  • - routing table |
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • diff --git a/doc/build/html/restapi.html b/doc/build/html/restapi.html index 8bc8b90..02ebddd 100644 --- a/doc/build/html/restapi.html +++ b/doc/build/html/restapi.html @@ -6,7 +6,7 @@ - REST API — Accounting API 0.1-beta documentation + REST API Documentation — Accounting API 0.1-beta documentation @@ -24,7 +24,7 @@ - + @@ -47,7 +47,7 @@ modules |
  • - previous |
  • Accounting API 0.1-beta documentation »
  • @@ -58,8 +58,11 @@
    -
    -

    REST API

    +
    +

    REST API Documentation

    +

    The accounting-api projects main application provides a REST API for accounting +data. This is the documentation for the various REST endpoints that the +accounting-api application provides.

    Get transactions

    @@ -259,7 +262,7 @@

    Table Of Contents

    diff --git a/doc/build/html/searchindex.js b/doc/build/html/searchindex.js index 4f3d2a1..6fba041 100644 --- a/doc/build/html/searchindex.js +++ b/doc/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({envversion:43,objnames:{"0":["http","delete","HTTP delete"],"1":["http","post","HTTP post"],"2":["http","get","HTTP get"],"3":["py","module","Python module"],"4":["py","method","Python method"],"5":["py","attribute","Python attribute"],"6":["py","class","Python class"],"7":["py","function","Python function"],"8":["py","exception","Python exception"]},objects:{"":{accounting:[0,3,0,"-"],"/transaction/":[6,0,1,"delete--transaction--string-transaction_id-"],"/transaction":[6,2,1,"get--transaction"]},"accounting.storage.sql.SQLStorage":{get_transactions:[2,4,1,""],update_transaction:[2,4,1,""],add_transaction:[2,4,1,""]},"accounting.gtkclient.AccountingApplication":{on_about_dialog_response:[0,4,1,""],on_show_about_activate:[0,4,1,""],on_transaction_view_cursor_changed:[0,4,1,""],load_ui:[0,4,1,""],on_transactions_loaded:[0,4,1,""],on_transaction_new_activate:[0,4,1,""],on_transaction_refresh_activate:[0,4,1,""]},"accounting.client":{print_balance_accounts:[0,7,1,""],print_transactions:[0,7,1,""],Client:[0,6,1,""],main:[0,7,1,""]},"accounting.storage.Storage":{get_accounts:[5,4,1,""],reverse_transaction:[5,4,1,""],get_transactions:[5,4,1,""],update_transaction:[5,4,1,""],add_transaction:[5,4,1,""],delete_transaction:[5,4,1,""],get_transaction:[5,4,1,""],get_account:[5,4,1,""]},"accounting.storage.sql.models.Amount":{as_dict:[2,4,1,""],symbol:[2,5,1,""],amount:[2,5,1,""],id:[2,5,1,""]},"accounting.storage.sql.models":{Posting:[2,6,1,""],Transaction:[2,6,1,""],Amount:[2,6,1,""]},"accounting.gtkclient":{AccountingApplication:[0,6,1,""],indicate_activity_done:[0,7,1,""],main:[0,7,1,""],indicate_activity:[0,7,1,""]},"accounting.models":{Posting:[0,6,1,""],Account:[0,6,1,""],Transaction:[0,6,1,""],Amount:[0,6,1,""]},"accounting.transport":{AccountingDecoder:[0,6,1,""],AccountingEncoder:[0,6,1,""]},"accounting.models.Transaction":{generate_id:[0,4,1,""]},"accounting.storage.sql.models.Transaction":{as_dict:[2,4,1,""],uuid:[2,5,1,""],payee:[2,5,1,""],meta:[2,5,1,""],date:[2,5,1,""],id:[2,5,1,""]},"accounting.transport.AccountingDecoder":{dict_to_object:[0,4,1,""]},"accounting.storage.ledgercli":{main:[5,7,1,""],Ledger:[5,6,1,""]},"accounting.web":{index:[0,7,1,""],transaction_options:[0,7,1,""],main:[0,7,1,""],transaction_delete:[0,7,1,""],transaction_post:[0,7,1,""],transaction_update:[0,7,1,""],init_ledger:[0,7,1,""],client:[0,7,1,""],transaction_by_id_options:[0,7,1,""],transaction_get:[0,7,1,""]},"accounting.exceptions":{AccountingException:[0,8,1,""]},"accounting.storage.ledgercli.Ledger":{locked_process:[5,4,1,""],init_process:[5,4,1,""],get_transactions:[5,4,1,""],add_transaction:[5,4,1,""],send_command:[5,4,1,""],assemble_arguments:[5,4,1,""],reg:[5,4,1,""],get_transaction:[5,4,1,""],update_transaction:[5,4,1,""],read_until_prompt:[5,4,1,""],delete_transaction:[5,4,1,""],bal:[5,4,1,""],get_process:[5,4,1,""]},"accounting.storage.sql.models.Posting":{as_dict:[2,4,1,""],account:[2,5,1,""],amount_id:[2,5,1,""],meta:[2,5,1,""],amount:[2,5,1,""],transaction:[2,5,1,""],transaction_uuid:[2,5,1,""],id:[2,5,1,""]},"accounting.client.Client":{get_balance:[0,4,1,""],get:[0,4,1,""],post:[0,4,1,""],get_register:[0,4,1,""],simple_transaction:[0,4,1,""]},"accounting.decorators":{allow_all_origins:[0,7,1,""],jsonify_exceptions:[0,7,1,""],cors:[0,7,1,""]},"accounting.storage":{Storage:[5,6,1,""],ledgercli:[5,3,0,"-"],sql:[2,3,0,"-"],TransactionNotFound:[5,8,1,""]},accounting:{storage:[5,3,0,"-"],exceptions:[0,3,0,"-"],config:[0,3,0,"-"],transport:[0,3,0,"-"],gtkclient:[0,3,0,"-"],decorators:[0,3,0,"-"],web:[0,3,0,"-"],models:[0,3,0,"-"],client:[0,3,0,"-"]},"accounting.storage.sql":{models:[2,3,0,"-"],SQLStorage:[2,6,1,""]},"accounting.transport.AccountingEncoder":{"default":[0,4,1,""]}},objtypes:{"0":"http:delete","1":"http:post","2":"http:get","3":"py:module","4":"py:method","5":"py:attribute","6":"py:class","7":"py:function","8":"py:exception"},titleterms:{except:0,subpackag:[0,5],usag:4,submodul:[0,2,5],depend:4,storag:[2,5],ledgercli:5,packag:[0,2,5],modul:[0,2,5],indic:1,ubuntu:4,rest:6,transport:0,gtkclient:0,config:0,welcom:1,web:0,instal:4,transact:6,decor:0,sql:2,client:[0,4],content:[0,2,5],model:[0,2],document:1,api:[1,4,6],account:[1,2,3,4,5,0],delet:6,add:6,gtk:4,get:6,develop:4,setup:4,tabl:1},terms:{on_transaction_view_cursor_chang:0,transaction_delet:0,main:[0,5],old:5,virtualenvwrapp:4,str:0,host:[0,6],virtualenv:4,npoacct:4,access:0,level:0,record:6,jsonencod:0,dict_to_object:0,project:6,mind:6,invoice20100101:6,mkvirtualenv:4,prompt:[4,5],stdin:5,termin:4,mean:4,current:0,init_ledg:0,widget:0,currenc:4,allow_nan:0,origin:0,simpl:4,sqlstorag:2,get_regist:0,you:[0,4,6],user:4,etc:4,all:[4,5,6],core:4,"function":[0,4],fals:0,out:[0,4],pip:4,kwarg:2,also:4,doe:4,ledger_bin:5,usd:4,wandborg:0,search:1,cross:0,ledger:[0,4,5],def:0,state:0,func:0,reg:[0,5],rent:4,usr:4,from:[0,4,5],clone:4,statu:6,conserv:4,apt:4,app:[0,2,5],world:0,unlock:5,print_transact:0,update_transact:[2,5],reverse_transact:5,git:4,regist:4,transaction_get:0,simple_transact:0,contain:0,packag:4,check:[0,4,5,6],from_acc:0,endpoint:0,context:5,transaction_by_id_opt:0,org:[0,4],log:4,head:4,ani:0,self:5,line:5,request:[0,6],read_until_prompt:5,callback:0,skipkei:0,yet:4,init_process:5,anoth:[4,6],donor:[0,6],arg:[2,5],runtimeerror:5,payload:0,string:6,transaction_post:0,"_generate_id":0,print_balance_account:0,contextlib:5,wrap:0,accountingencod:0,make:4,have:4,until:5,onc:5,foo:[0,6],cors_endpoint:0,delete_transact:5,as_dict:2,take:[0,5],requir:[0,4],initi:0,run:[4,5],when:5,control:0,on_transaction_new_activ:0,donat:[0,6],evalu:5,name:0,creat:5,generate_id:0,work:4,accountingexcept:[0,5],add_transact:[2,5],exampl:[0,6],describ:4,januari:4,output:[0,5],combin:5,accountingdecod:0,"try":4,on_transactions_load:0,back:5,follow:4,ledger_process:5,json_decod:0,func_or_str:0,send_command:5,execut:5,code:4,web:4,instanc:5,sfconserv:0,json_encod:0,bal:5,argument:[0,5],resourc:0,restricted_cors_endpoint:0,storag:0,databas:5,indicate_act:0,text:5,pdf:6,handl:5,mode:5,webservic:0,servic:4,shell:4,command:5,index:[0,1],sai:4,statement:5,asset:[0,4,6],path:[0,4],autodetect:4,base:[0,2,5],mbudd:4,incom:[0,6],paramet:[0,6],get_bal:0,paye:[0,2,6],insert:4,workon:4,process:5,system:4,remov:5,look:5,end:4,found:5,applic:6,purpos:4,suitabl:5,argv:[0,5],metadata:[0,6],hello:0,serial:0,allow_all_origin:0,jsonifi:0,subprocess:5,would:4,logic:0,which:[0,4,5],thi:[0,4,5],flask_sqlalchemi:2,sudo:4,bound:5,serv:4,header:0,contextmanag:5,balanc:4,xhr:0,see:4,avaiabl:4,irc:4,local:4,add:[1,4,5],respons:6,prog:0,set:[4,5],"__type__":[0,6],on_transaction_refresh_activ:0,method:[0,4,5],within:5,flag:4,on_about_dialog_respons:0,ledger_fil:[4,5],channel:4,messag:0,meta:2,below:4,page:1,load:5,updat:[4,5],separ:0,discard:5,environ:4,freenod:4,option:0,builtin:[0,5],caller:0,get_process:5,can:[0,4,5,6],gitori:4,annot:0,join:0,before_request:0,popen:5,python:4,indent:0,assemble_argu:5,jsonify_except:0,symbol:[0,4,2,6],"class":[0,2,5],json:[0,6],collid:6,arrai:6,alreadi:5,kindli:[0,6],how:4,txt:[4,6],domain:0,uuid:2,them:5,without:5,thei:6,transaction_upd:0,get_transact:[2,5],file:[0,5],yield:5,report:4,rest:[0,1],presum:5,sort_kei:0,result:5,transact:[0,1,4,2,5],http:[0,6],memori:5,indicate_activity_don:0,accept:6,want:[0,4],x20:5,repositori:4,lock:5,"return":[0,5],to_acc:0,need:4,delet:[1,5],"new":5,net:4,transaction_id:[0,5,6],earmark:6,load_ui:0,cor:0,"default":0,restrict:0,sourc:[0,4,2,5],anyth:6,restrict_domain:0,open:5,amount_id:2,sql:[0,5],sinc:5,rout:0,high:0,amount:[0,2,6],well:4,should:5,approv:6,went:4,list:[5,6],read:5,locked_process:5,manag:5,section:4,find:5,banner:5,transactionnotfound:5,ensure_ascii:0,object:[0,5,6],becom:0,transaction_uuid:2,ppa:4,flask:[0,4],post:[0,2,6],via:[0,4],accountingappl:0,response_typ:0,write:[0,5],bin:4,"true":[0,5],site:4,expens:4,pass:5,none:[0,2,5],boundari:5,get:[0,1,4],ledgercli:0,your:4,filter:0,jsondecod:0,transaction_opt:0,check_circular:0,type:6,version:4,abc:5,python3:4,"catch":0,recommend:5,date:[0,2,6],invoic:6,on_show_about_activ:0,get_account:5,tri:4,origin_callback:0},titles:["accounting package","Welcome to Accounting API’s documentation!","accounting.storage.sql package","accounting","The Accounting API","accounting.storage package","REST API"],filenames:["api/accounting","index","api/accounting.storage.sql","api/modules","README","api/accounting.storage","restapi"]}) \ No newline at end of file +Search.setIndex({titleterms:{setup:2,client:[4,2],account:[1,0,2,4,5,6],content:[0,4,5],ubuntu:2,transport:4,submodul:[0,4,5],subpackag:[4,5],delet:3,get:3,transact:3,document:3,usag:2,instal:2,rest:3,web:4,config:4,readm:2,ledgercli:5,depend:2,tabl:1,model:[0,4],decor:4,except:4,modul:[0,4,5],api:[1,2,3],packag:[0,4,5],storag:[0,5],add:3,sql:0,gtkclient:4,index:1,indic:1,gtk:2,develop:2},objects:{"":{accounting:[4,0,0,"-"],"/transaction/":[3,8,1,"delete--transaction--string-transaction_id-"],"/transaction":[3,7,1,"post--transaction"]},"accounting.storage.Storage":{get_account:[5,1,1,""],update_transaction:[5,1,1,""],get_accounts:[5,1,1,""],get_transaction:[5,1,1,""],reverse_transaction:[5,1,1,""],get_transactions:[5,1,1,""],add_transaction:[5,1,1,""],delete_transaction:[5,1,1,""]},"accounting.storage.sql":{models:[0,0,0,"-"],SQLStorage:[0,4,1,""]},"accounting.transport.AccountingDecoder":{dict_to_object:[4,1,1,""]},"accounting.web":{transaction_get:[4,2,1,""],client:[4,2,1,""],init_ledger:[4,2,1,""],index:[4,2,1,""],transaction_options:[4,2,1,""],transaction_delete:[4,2,1,""],transaction_update:[4,2,1,""],main:[4,2,1,""],transaction_by_id_options:[4,2,1,""],transaction_post:[4,2,1,""]},"accounting.models":{Amount:[4,4,1,""],Posting:[4,4,1,""],Account:[4,4,1,""],Transaction:[4,4,1,""]},"accounting.transport.AccountingEncoder":{"default":[4,1,1,""]},accounting:{decorators:[4,0,0,"-"],models:[4,0,0,"-"],config:[4,0,0,"-"],exceptions:[4,0,0,"-"],web:[4,0,0,"-"],transport:[4,0,0,"-"],storage:[5,0,0,"-"],client:[4,0,0,"-"],gtkclient:[4,0,0,"-"]},"accounting.gtkclient.AccountingApplication":{on_transaction_view_cursor_changed:[4,1,1,""],on_transactions_loaded:[4,1,1,""],load_ui:[4,1,1,""],on_show_about_activate:[4,1,1,""],on_about_dialog_response:[4,1,1,""],on_transaction_refresh_activate:[4,1,1,""],on_transaction_new_activate:[4,1,1,""]},"accounting.client":{print_balance_accounts:[4,2,1,""],main:[4,2,1,""],print_transactions:[4,2,1,""],Client:[4,4,1,""]},"accounting.client.Client":{get_balance:[4,1,1,""],get:[4,1,1,""],get_register:[4,1,1,""],simple_transaction:[4,1,1,""],post:[4,1,1,""]},"accounting.storage.sql.models.Posting":{amount:[0,3,1,""],transaction_uuid:[0,3,1,""],amount_id:[0,3,1,""],account:[0,3,1,""],as_dict:[0,1,1,""],meta:[0,3,1,""],id:[0,3,1,""],transaction:[0,3,1,""]},"accounting.transport":{AccountingEncoder:[4,4,1,""],AccountingDecoder:[4,4,1,""]},"accounting.storage.ledgercli.Ledger":{send_command:[5,1,1,""],locked_process:[5,1,1,""],bal:[5,1,1,""],update_transaction:[5,1,1,""],get_process:[5,1,1,""],reg:[5,1,1,""],delete_transaction:[5,1,1,""],add_transaction:[5,1,1,""],init_process:[5,1,1,""],assemble_arguments:[5,1,1,""],get_transaction:[5,1,1,""],get_transactions:[5,1,1,""],read_until_prompt:[5,1,1,""]},"accounting.decorators":{jsonify_exceptions:[4,2,1,""],allow_all_origins:[4,2,1,""],cors:[4,2,1,""]},"accounting.gtkclient":{indicate_activity:[4,2,1,""],indicate_activity_done:[4,2,1,""],main:[4,2,1,""],AccountingApplication:[4,4,1,""]},"accounting.storage.sql.SQLStorage":{update_transaction:[0,1,1,""],get_transactions:[0,1,1,""],add_transaction:[0,1,1,""]},"accounting.storage.sql.models":{Amount:[0,4,1,""],Posting:[0,4,1,""],Transaction:[0,4,1,""]},"accounting.storage":{sql:[0,0,0,"-"],Storage:[5,4,1,""],ledgercli:[5,0,0,"-"]},"accounting.exceptions":{AccountingException:[4,5,1,""],TransactionNotFound:[4,5,1,""]},"accounting.models.Transaction":{generate_id:[4,1,1,""]},"accounting.storage.ledgercli":{main:[5,2,1,""],Ledger:[5,4,1,""]},"accounting.storage.sql.models.Amount":{symbol:[0,3,1,""],amount:[0,3,1,""],id:[0,3,1,""],as_dict:[0,1,1,""]},"accounting.storage.sql.models.Transaction":{meta:[0,3,1,""],uuid:[0,3,1,""],as_dict:[0,1,1,""],date:[0,3,1,""],payee:[0,3,1,""],id:[0,3,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","function","Python function"],"3":["py","attribute","Python attribute"],"4":["py","class","Python class"],"5":["py","exception","Python exception"],"6":["http","get","HTTP get"],"7":["http","post","HTTP post"],"8":["http","delete","HTTP delete"]},objtypes:{"0":"py:module","1":"py:method","2":"py:function","3":"py:attribute","4":"py:class","5":"py:exception","6":"http:get","7":"http:post","8":"http:delete"},envversion:43,titles:["accounting.storage.sql package","Index","accounting-api README","REST API Documentation","accounting package","accounting.storage package","accounting"],filenames:["api/accounting.storage.sql","index","README","restapi","api/accounting","api/accounting.storage","api/modules"],terms:{app:[0,4,5],conserv:2,hello:4,apt:2,net:2,log:2,print_balance_account:4,post:[0,4,3],update_transact:[0,5],avaiabl:2,ledgercli:4,contextmanag:5,locked_process:5,banner:5,kindli:[4,3],open:5,python:2,code:2,txt:[2,3],"default":4,logic:4,read:5,process:5,send_command:5,discard:5,your:2,foo:[4,3],builtin:[4,5],anyth:3,func_or_str:4,doe:2,memori:5,thi:[4,5,2,3],local:2,accountingexcept:4,variou:3,follow:2,jsondecod:4,get_transact:[0,5],databas:5,get_bal:4,amount_id:0,rout:4,header:4,date:[0,4,3],data:3,januari:2,access:4,collid:3,without:5,method:[4,5,2],separ:4,ledger_process:5,symbol:[0,4,2,3],on_transactions_load:4,updat:[5,2],ani:4,below:2,webservic:4,flask:[4,2],donor:[4,3],"new":5,you:[4,2,3],json:[4,3],manag:5,reverse_transact:5,assemble_argu:5,"catch":4,via:[4,2],index:4,servic:2,pdf:3,metadata:[4,3],mean:2,resourc:4,response_typ:4,contextlib:5,domain:4,delete_transact:5,bin:2,runtimeerror:5,print_transact:4,git:2,back:5,self:5,paramet:[4,3],describ:2,version:2,incom:[4,3],invoice20100101:3,check:[4,5,2,3],get_regist:4,http:[4,3],rent:2,mkvirtualenv:2,transact:[0,4,5,2],freenod:2,transaction_upd:4,restrict:4,storag:4,ledger_fil:[5,2],host:[4,3],page:1,annot:4,indicate_act:4,messag:4,virtualenvwrapp:2,find:5,within:5,applic:3,cors_endpoint:4,which:[4,5,2],write:[4,5],meta:0,record:3,on_about_dialog_respons:4,balanc:2,insert:2,origin:4,dict_to_object:4,name:4,all:[5,2,3],control:4,etc:2,restrict_domain:4,"class":[0,4,5],expens:2,accountingappl:4,environ:2,would:2,callback:4,fals:4,amount:[0,4,3],sourc:[0,4,5,2],paye:[0,4,3],workon:2,sai:2,core:2,run:[5,2],flask_sqlalchemi:0,mode:5,str:4,web:2,sort_kei:4,transaction_get:4,file:[4,5],also:2,init_process:5,npoacct:2,serial:4,reg:[4,5],evalu:5,load_ui:4,kwarg:0,invoic:3,none:[0,4,5],text:5,"true":[4,5],"return":[4,5],alreadi:5,add_transact:[0,5],clone:2,ledger:[4,5,2],from_acc:4,def:4,context:5,command:5,repositori:2,option:4,ppa:2,how:2,regist:2,statement:5,high:4,respons:3,read_until_prompt:5,take:[4,5],section:2,yield:5,purpos:2,termin:2,combin:5,well:2,want:[4,2],widget:4,transaction_by_id_opt:4,project:3,payload:4,need:2,until:5,sql:[4,5],asset:[4,2,3],jsonencod:4,pip:2,to_acc:4,stdin:5,json_decod:4,cross:4,transaction_uuid:0,make:2,transaction_delet:4,object:[4,5,3],instanc:5,base:[0,4,5],transaction_post:4,check_circular:4,caller:4,irc:2,state:4,ledger_bin:5,mind:3,sfconserv:4,restricted_cors_endpoint:4,remov:5,lock:5,statu:3,when:5,head:2,prog:4,provid:3,transaction_opt:4,channel:2,them:5,thei:3,output:[4,5],ensure_ascii:4,bound:5,filter:4,path:[4,2],boundari:5,report:2,get_account:5,accept:3,out:[4,2],get_process:5,user:2,tri:2,get:[4,2],exampl:[4,3],went:2,"try":2,sudo:2,bal:5,contain:4,world:4,flag:2,join:4,system:2,as_dict:0,have:2,python3:2,argument:[4,5],on_show_about_activ:4,load:5,site:2,see:2,wandborg:4,level:4,autodetect:2,set:[5,2],popen:5,transaction_id:[4,5,3],arrai:3,virtualenv:2,gitori:2,transactionnotfound:[4,5],found:5,donat:[4,3],uuid:0,old:5,add:[5,2],line:5,jsonifi:4,subprocess:5,delet:5,on_transaction_view_cursor_chang:4,currenc:2,simpl:2,on_transaction_new_activ:4,generate_id:4,shell:2,earmark:3,current:4,prompt:[5,2],json_encod:4,accountingdecod:4,jsonify_except:4,approv:3,look:5,accountingencod:4,end:2,unlock:5,recommend:5,on_transaction_refresh_activ:4,packag:2,handl:5,from:[4,5,2],x20:5,"function":[4,2],allow_nan:4,work:2,becom:4,init_ledg:4,cor:4,arg:[0,5],yet:2,rest:4,presum:5,allow_all_origin:4,simple_transact:4,serv:2,skipkei:4,sqlstorag:0,request:[4,3],"__type__":[4,3],indicate_activity_don:4,sinc:5,indent:4,argv:[4,5],result:5,execut:5,should:5,func:4,onc:5,mbudd:2,type:3,abc:5,org:[4,2],origin_callback:4,endpoint:[4,3],wrap:4,"_generate_id":4,search:1,anoth:[2,3],string:3,requir:[4,2],can:[4,5,2,3],xhr:4,usr:2,creat:5,main:[4,5,3],suitabl:5,list:[5,3],usd:2,pass:5}}) \ No newline at end of file diff --git a/doc/source/index.rst b/doc/source/index.rst index 6e32d15..864fa43 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1,10 +1,6 @@ -.. Accounting API documentation master file, created by - sphinx-quickstart on Thu Dec 12 14:02:01 2013. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to Accounting API's documentation! -========================================== +======= + Index +======= ----------------------- Accounting API diff --git a/doc/source/restapi.rst b/doc/source/restapi.rst index 42b7998..1e3e1ae 100644 --- a/doc/source/restapi.rst +++ b/doc/source/restapi.rst @@ -1,6 +1,10 @@ -========== - REST API -========== +======================== + REST API Documentation +======================== + +The accounting-api projects main application provides a REST API for accounting +data. This is the documentation for the various REST endpoints that the +accounting-api application provides. Get transactions ---------------- @@ -28,63 +32,63 @@ Get transactions { "transactions": [ { - "__type__": "Transaction", - "date": "2010-01-01", - "id": "Ids can be anything", - "metadata": {}, - "payee": "Kindly T. Donor", + "__type__": "Transaction", + "date": "2010-01-01", + "id": "Ids can be anything", + "metadata": {}, + "payee": "Kindly T. Donor", "postings": [ { - "__type__": "Posting", - "account": "Income:Foo:Donation", + "__type__": "Posting", + "account": "Income:Foo:Donation", "amount": { - "__type__": "Amount", - "amount": "-100", + "__type__": "Amount", + "amount": "-100", "symbol": "$" - }, + }, "metadata": { "Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf" } - }, + }, { - "__type__": "Posting", - "account": "Assets:Checking", + "__type__": "Posting", + "account": "Assets:Checking", "amount": { - "__type__": "Amount", - "amount": "100", + "__type__": "Amount", + "amount": "100", "symbol": "$" - }, + }, "metadata": {} } ] - }, + }, { - "__type__": "Transaction", - "date": "2011-03-15", - "id": "but mind you if they collide.", - "metadata": {}, - "payee": "Another J. Donor", + "__type__": "Transaction", + "date": "2011-03-15", + "id": "but mind you if they collide.", + "metadata": {}, + "payee": "Another J. Donor", "postings": [ { - "__type__": "Posting", - "account": "Income:Foo:Donation", + "__type__": "Posting", + "account": "Income:Foo:Donation", "amount": { - "__type__": "Amount", - "amount": "-400", + "__type__": "Amount", + "amount": "-400", "symbol": "$" - }, + }, "metadata": { "Approval": "Projects/Foo/earmark-record.txt" } - }, + }, { - "__type__": "Posting", - "account": "Assets:Checking", + "__type__": "Posting", + "account": "Assets:Checking", "amount": { - "__type__": "Amount", - "amount": "400", + "__type__": "Amount", + "amount": "400", "symbol": "$" - }, + }, "metadata": {} } ] @@ -111,36 +115,36 @@ Add transactions { "transactions": [ { - "__type__": "Transaction", - "date": "2010-01-01", - "id": "Ids can be anything", - "metadata": {}, - "payee": "Kindly T. Donor", + "__type__": "Transaction", + "date": "2010-01-01", + "id": "Ids can be anything", + "metadata": {}, + "payee": "Kindly T. Donor", "postings": [ { - "__type__": "Posting", - "account": "Income:Foo:Donation", + "__type__": "Posting", + "account": "Income:Foo:Donation", "amount": { - "__type__": "Amount", - "amount": "-100", + "__type__": "Amount", + "amount": "-100", "symbol": "$" - }, + }, "metadata": { "Invoice": "Projects/Foo/Invoices/Invoice20100101.pdf" } - }, + }, { - "__type__": "Posting", - "account": "Assets:Checking", + "__type__": "Posting", + "account": "Assets:Checking", "amount": { - "__type__": "Amount", - "amount": "100", + "__type__": "Amount", + "amount": "100", "symbol": "$" - }, + }, "metadata": {} } ] - }, + }, ] }