experimental-accounting-api
Find a file
2013-12-29 22:14:59 +01:00
accounting [ledgercli] Do not remove the old transaction on invalid update 2013-12-29 22:14:59 +01:00
bin [tests] Added bin/runtests 2013-12-26 13:26:23 +01:00
doc [doc] Updated restapi documentation 2013-12-26 21:07:17 +01:00
tests Addded tests/ folder with example payloads 2013-12-16 07:38:45 +01:00
.gitignore [doc] Fixed .gitignore and added pre-built README.html 2013-12-18 18:50:24 +01:00
AGPLv3 Rename LICENSE file to AGPLv3. 2013-12-17 07:52:57 -05:00
LICENSE [docs] Changed the theme to the Flask theme 2013-12-20 16:00:09 +01:00
non-profit-test-data.ledger [test] Added unit tests 2013-12-21 00:24:37 +01:00
PSF-PY3.3-LICENSE [doc] Added pydoctheme 2013-12-18 19:14:47 +01:00
README.rst [doc] Changed the README title for better inclusion in doc 2013-12-26 13:21:26 +01:00
requirements.txt Added sphinxcontrib-httpdomain to dependencies 2013-12-20 14:54:30 +01:00
SPHINX-LICENSE Added sphinx license 2013-12-17 15:30:12 +01:00

.. vim: textwidth=80

=======================
 accounting-api README
=======================

--------------
 Dependencies
--------------

-   Python >=3.3
-   ledger version 3 (I have not tried with version 2.x)
-   Python packages: Flask, etc. (install by running ``pip install -r
    requirements.txt``)

~~~~~~~~~~~~~~~~~~~~~~~~~
 GTK Client Dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~

To run the GTK client you need to have ``gi.repository`` avaiable in the python
environment, this means that if you use virtualenv to install the dependencies
of accounting-api you need to set it up with the ``--system-site-packages``
flag.

---------------------------------------
 Installation (i.e. Development Setup)
---------------------------------------

accounting-api does not yet have a method for end-user installation. This
section describes how you would set up accounting-api for development purposes,
which can also be used as an environment to try out the functionality of
accounting-api.

See the sections below on how to install the dependencies. Then run the
following in your shell.

.. code-block:: bash

    # Get the source code
    git clone git://gitorious.org/conservancy/accounting-api.git
    cd accounting-api

    # Set up the python 3.3 virtualenv (this will make the GTK client not work)
    mkvirtualenv -p /usr/bin/python3.3 accounting-api
    # OR If you want the GTK client to work
    mkvirtualenv -p /usr/bin/python3.3 --system-site-packages accounting-api

    # If your terminal prompt does not say "(accounting-api)", run
    workon accounting-api

    # Install the python packages
    pip-3.3 install -r requirements.txt

If all went well, head to :ref:`usage`. If not, head to the channel ``#npoacct``
on ``irc.freenode.net``.

~~~~~~~~
 Ubuntu
~~~~~~~~


.. code-block:: bash

    # git python 3.3 and virtualenvwrapper
    sudo apt-get install git-core python3.3 virtualenvwrapper

    # ledger 3
    sudo apt-add-repository ppa:mbudde/ledger
    sudo apt-get update
    sudo apt-get install ledger


.. _usage:

-------
 Usage
-------

.. code-block:: bash

    # Run the web service
    LEDGER_FILE=../path/to/your.ledger ./bin/serve

    # Get a balance report via the web service
    ./bin/client balance

    # Get the transaction log
    ./bin/client register

    # Insert a simple transaction, currency will be autodetected from your
    # locale, for another currency, use ``--symbol USD``
    ./bin/client insert "January rent" Assets:Checking Expenses:Rent 654.32