diff --git a/doc/build/html/README.html b/doc/build/html/README.html index c758dbb212c0aa00797f8d925ec900150a80dd5a..2f01152cdda23973030bd25d3e4324b3c734c811 100644 --- a/doc/build/html/README.html +++ b/doc/build/html/README.html @@ -24,7 +24,7 @@ - + @@ -38,7 +38,10 @@ modules |
  • - routing table |
  • +
  • + next |
  • Welcome to Accounting API’s documentation!

    Next topic

    -

    accounting package

    +

    REST API

    This Page

    @@ -378,8 +381,8 @@ the ledger file.

    Previous topic

    -

    The Accounting API

    +

    REST API

    Next topic

    accounting.storage package

    @@ -414,11 +417,14 @@ the ledger file.

  • modules |
  • +
  • + routing table |
  • next |
  • - previous |
  • Accounting API 0.1-beta documentation »
  • diff --git a/doc/build/html/api/accounting.storage.html b/doc/build/html/api/accounting.storage.html index 8bef1d064e3f51afdc8dfdf016a7a294dd8bc87f..559920a19aaebf6dcf8e76cd33c875ab20bc1871 100644 --- a/doc/build/html/api/accounting.storage.html +++ b/doc/build/html/api/accounting.storage.html @@ -38,6 +38,9 @@
  • modules |
  • +
  • + routing table |
  • next |
  • @@ -309,6 +312,9 @@ the old transaction using modules | +
  • + routing table |
  • next |
  • diff --git a/doc/build/html/api/accounting.storage.sql.html b/doc/build/html/api/accounting.storage.sql.html index 4a6277d2e5a59b57df58cef2dea5b179be7dfba3..0882335e4897f534599898dabc3d81a45fa1e2d0 100644 --- a/doc/build/html/api/accounting.storage.sql.html +++ b/doc/build/html/api/accounting.storage.sql.html @@ -37,6 +37,9 @@
  • modules |
  • +
  • + routing table |
  • previous |
  • @@ -243,6 +246,9 @@
  • modules |
  • +
  • + routing table |
  • previous |
  • diff --git a/doc/build/html/api/modules.html b/doc/build/html/api/modules.html index 908bd74627d99effd9a365e252ecbd785dad316f..3010a58f141277905cb59eb62d4a9f888e4b1979 100644 --- a/doc/build/html/api/modules.html +++ b/doc/build/html/api/modules.html @@ -35,6 +35,9 @@
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • @@ -112,6 +115,9 @@
  • modules |
  • +
  • + routing table |
  • Accounting API 0.1-beta documentation »
  • diff --git a/doc/build/html/genindex.html b/doc/build/html/genindex.html index db08df04bca8e8313b0eca1315e9de048ca77fd5..fff2cada3c2d60e0fa4c362d6b4aaf63cf629128 100644 --- a/doc/build/html/genindex.html +++ b/doc/build/html/genindex.html @@ -33,6 +33,9 @@
  • index
  • +
  • + routing table |
  • modules |
  • @@ -639,6 +642,9 @@
  • index
  • +
  • + routing table |
  • modules |
  • diff --git a/doc/build/html/http-routingtable.html b/doc/build/html/http-routingtable.html new file mode 100644 index 0000000000000000000000000000000000000000..6a71632f6e399efb9586359f93112739f8c71cee --- /dev/null +++ b/doc/build/html/http-routingtable.html @@ -0,0 +1,128 @@ + + + + + + + + HTTP Routing Table — Accounting API 0.1-beta documentation + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +

    HTTP Routing Table

    + + + + + + + + + + + + + + + +
     
    + /transaction
    + GET /transaction +
    + POST /transaction +
    + DELETE /transaction/<string:transaction_id> +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/doc/build/html/index.html b/doc/build/html/index.html index 7d7c23802b56be7575595a0225e1fe4f619f1343..80a3e4f08ad08c5f619dacb678a6ad60d39549f4 100644 --- a/doc/build/html/index.html +++ b/doc/build/html/index.html @@ -33,6 +33,9 @@
  • index
  • +
  • + routing table |
  • modules |
  • @@ -59,6 +62,12 @@
  • Usage
  • +
  • REST API +
  • accounting package
    • Subpackages
    • Submodules
    • @@ -130,6 +139,9 @@
    • index
    • +
    • + routing table |
    • modules |
    • diff --git a/doc/build/html/objects.inv b/doc/build/html/objects.inv index 4afa71759f9f732076d301e9cd895fa5e170b326..cbd2bb7ccf1694428bc490f0abdb5eb1f111d83d 100644 GIT binary patch delta 1088 zcmV-G1i$;=2(}53g@0L5Z`(Kwe($d^u)W&7z7~f8#nu4_bVKjDdo~n_akR;jPmm83nGhW`AD`(lW^Y$jt6rPpDJm9_Am%``=&_xl?H&Q3VA9Qh_u^T+-7EU(jb( zfvHGiI{!36#=2pZ5BtNZ|JZ_4_|nUirqi}EL|E`Gt>U~C>01KWm}N|h%?xYx2M>iRD9SM!)yl|wMYwAv8*{Ci;U;CN1f z?i*Ur&PJpS;cwcmI?RD}UjMV9fBOgxIkZCmDB@krB!5&?X^@xV6=vy$M2a}R?_Ppj z%&z2MCzbF8FMmJv@Ms%rypND20GWG<4?fTQ6B79O5Ivs6xpcakTxRX_)nieT8wi z+KIOkZGS|oosSOiOL&e3?I9JUUydEl4E+RV;PqL(O!kUNvv5+EW9eZ*w)oY*WC9T& zq1iI#k!~0Y)Nl@wkGw-pWUnEo9I85;!cuDZe zZ7zBmh-<}FM{lLO48NwK9iUg%&Y5VY`nY1yy!P~GZe>++kERRSxR@zgH*B%qC2mMZ z56fAN|uZd&b4a>h=4Ih0g`x^DNXJf+5pS)yUeXQne4?0JUN@A z-bKu4GP0_5b>wckJnwozu9wlu#6hGXjPp!rk z?4S63Kf8Op?>1i*f8B;p6^Ikqo3A}^ho}K7vfSU;ee1V9cYhn694;nAw!$z`l@y3n z*hr?2ET+4bd%LUlrFr0O1UTi9Gxc^T?C-EAUvEjlx1VQpJi*q*$;j z^02nbcGe#_-ESE{NxQq$|M-;q?Y1ds9B2i~5+UtPC43NQ43i?(u9bOBqND%rae~Ea zseD-fE4d`EKz~uABmv#s1ZF8|aWkm9QJKp>j^3C!O_mK_!J2E>7{%tTf%EX&hn%_M zx&N)eAhWw8S@c8AI6T6!)kzk((jq}U=YX)P+S<}1Sz=GaKc)F@m#Kr?5;zQXOWV@M zbw;qUl3MIHW>yY$(F$@Jbc(UshB`pcUYB9o1fz}d%YOr&)ow8XbEnhU_T#K+xKpq5 z3n>tu%hn*uFqailU=xDSFr=Ia_p?wqllL9bI=34-0iJ(7qS=YFWROw1~^iWVSZMuM+sO%?ev%ap0 z^!Q%9Mt?D3&>V9th>N4^bsZi@Cm7844#XvQz0LJQ4nc&=m+!E^jfKEp6K}AU&Z@DT-`; zxUhZIGP;}%yzY&`J0h*pQX#U$q6)9awv$2c#(P1mVU(>)7P#dm{t;Osm!E86&FCCD zO@Ek!UNNGL3vLzjm4#=ou>DLd<|*RbK~Ef8ZXhF(oWB4G=FeVVbJ&oFS#LM&FJH72 zY_UT7GuJpW?DRNJsxeyn{@j-rVM1-<^3FqY)YD9`OBU31#`JfB)tDl;iMtonO;Xs{ zt3{hlP7O2Bj&pvL-Of&j2dVM3^QH8gZ(+hZkbM%W!d;wBn64b!zKh1;w(shH>r8w* z>d!luadQ~dvXnuLm)PQL8`1S%pet4I21;LQ^uG~2P>Kx-2*%ZSYh8 diff --git a/doc/build/html/py-modindex.html b/doc/build/html/py-modindex.html index 9501b618177b2a0666f0176c861837207fe4b49d..c7b3ddf7b1079cf16d658230dc4e0ca35af6bdc7 100644 --- a/doc/build/html/py-modindex.html +++ b/doc/build/html/py-modindex.html @@ -35,6 +35,9 @@
    • index
    • +
    • + routing table |
    • modules |
    • @@ -155,6 +158,9 @@
    • index
    • +
    • + routing table |
    • modules |
    • diff --git a/doc/build/html/restapi.html b/doc/build/html/restapi.html new file mode 100644 index 0000000000000000000000000000000000000000..7c7f50db7ca1a00d87662802c65e30e7d1dc1e8a --- /dev/null +++ b/doc/build/html/restapi.html @@ -0,0 +1,318 @@ + + + + + + + + REST API — Accounting API 0.1-beta documentation + + + + + + + + + + + + + + + +
      +
      +
      +
      + +
      +

      REST API

      +
      +

      Get transactions

      +
      +
      +GET /transaction
      +

      Get all transactions

      +

      Example request

      +
      GET /transaction HTTP/1.1
      +Host: accounting.example
      +Accept: application/json
      +
      +
      +

      Example response

      +
      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

      +
      +
      +POST /transaction
      +
      +++ + + + + +
      Json Parameters:
       
        +
      • transactions (array) – A list of Transaction objects to add.
      • +
      +
      +

      Example request

      +
      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

      +
      HTTP/1.1 200 OK
      +Content-Type: application/json
      +
      +{
      +  "status": "OK",
      +  "transaction_ids": [
      +    "Ids can be anything"
      +  ]
      +}
      +
      +
      +
      + +
      +
      +

      Delete a transaction

      +
      +
      +DELETE /transaction/<string:transaction_id>
      +

      Delete the transaction with ID transaction_id.

      +

      Example request

      +
      DELETE /transaction/123456 HTTP/1.1
      +Host: accounting.example
      +Accept: application/json
      +
      +
      +

      Example response

      +
      HTTP/1.1 200 OK
      +Content-Type: application/json
      +
      +{
      +  "status": "OK"
      +}
      +
      +
      +
      + +
      +
      + + +
      +
      +
      +
      +
      +

      Table Of Contents

      + + +

      Previous topic

      +

      The Accounting API

      +

      Next topic

      +

      accounting package

      +

      This Page

      + + + +
      +
      +
      +
      + + + + \ No newline at end of file diff --git a/doc/build/html/search.html b/doc/build/html/search.html index d3a3103886e2c6dc68270f4f72518107959d3ffc..2ebd0bb3a0eba5e6bff8bff605892929a092795d 100644 --- a/doc/build/html/search.html +++ b/doc/build/html/search.html @@ -40,6 +40,9 @@
    • index
    • +
    • + routing table |
    • modules |
    • @@ -91,6 +94,9 @@
    • index
    • +
    • + routing table |
    • modules |
    • diff --git a/doc/build/html/searchindex.js b/doc/build/html/searchindex.js index cdcfef63c9dfeb3756ea3e46372e9198539e0b73..79435869c41ba74296788f958e4aae532057c334 100644 --- a/doc/build/html/searchindex.js +++ b/doc/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{"":{accounting:[4,0,0,"-"]},"accounting.decorators":{jsonify_exceptions:[4,5,1,""]},"accounting.gtkclient.AccountingApplication":{on_transactions_loaded:[4,1,1,""],on_transaction_refresh_activate:[4,1,1,""],on_transaction_view_cursor_changed:[4,1,1,""],load_ui:[4,1,1,""],on_show_about_activate:[4,1,1,""],on_about_dialog_response:[4,1,1,""]},"accounting.models.Transaction":{generate_id:[4,1,1,""]},"accounting.storage.ledgercli.Ledger":{get_transaction:[2,1,1,""],add_transaction:[2,1,1,""],reg:[2,1,1,""],assemble_arguments:[2,1,1,""],get_process:[2,1,1,""],send_command:[2,1,1,""],bal:[2,1,1,""],delete_transaction:[2,1,1,""],update_transaction:[2,1,1,""],read_until_prompt:[2,1,1,""],init_process:[2,1,1,""],get_transactions:[2,1,1,""],locked_process:[2,1,1,""]},"accounting.storage":{TransactionNotFound:[2,4,1,""],Storage:[2,3,1,""],ledgercli:[2,0,0,"-"],sql:[0,0,0,"-"]},accounting:{models:[4,0,0,"-"],web:[4,0,0,"-"],client:[4,0,0,"-"],decorators:[4,0,0,"-"],transport:[4,0,0,"-"],exceptions:[4,0,0,"-"],config:[4,0,0,"-"],storage:[2,0,0,"-"],gtkclient:[4,0,0,"-"]},"accounting.storage.sql":{models:[0,0,0,"-"],SQLStorage:[0,3,1,""]},"accounting.transport.AccountingEncoder":{"default":[4,1,1,""]},"accounting.storage.sql.SQLStorage":{update_transaction:[0,1,1,""],add_transaction:[0,1,1,""],get_transactions:[0,1,1,""]},"accounting.storage.sql.models.Transaction":{date:[0,2,1,""],as_dict:[0,1,1,""],id:[0,2,1,""],payee:[0,2,1,""],meta:[0,2,1,""],uuid:[0,2,1,""]},"accounting.gtkclient":{indicate_activity_done:[4,5,1,""],indicate_activity:[4,5,1,""],main:[4,5,1,""],AccountingApplication:[4,3,1,""]},"accounting.client.Client":{get_register:[4,1,1,""],simple_transaction:[4,1,1,""],post:[4,1,1,""],get_balance:[4,1,1,""],get:[4,1,1,""]},"accounting.storage.sql.models.Amount":{amount:[0,2,1,""],symbol:[0,2,1,""],as_dict:[0,1,1,""],id:[0,2,1,""]},"accounting.client":{print_transactions:[4,5,1,""],Client:[4,3,1,""],print_balance_accounts:[4,5,1,""],main:[4,5,1,""]},"accounting.web":{index:[4,5,1,""],transaction_get:[4,5,1,""],init_ledger:[4,5,1,""],main:[4,5,1,""],transaction_delete:[4,5,1,""],transaction_post:[4,5,1,""],transaction_update:[4,5,1,""]},"accounting.storage.sql.models.Posting":{meta:[0,2,1,""],as_dict:[0,1,1,""],id:[0,2,1,""],account:[0,2,1,""],transaction:[0,2,1,""],amount:[0,2,1,""],amount_id:[0,2,1,""],transaction_uuid:[0,2,1,""]},"accounting.models":{Amount:[4,3,1,""],Transaction:[4,3,1,""],Account:[4,3,1,""],Posting:[4,3,1,""]},"accounting.transport":{AccountingEncoder:[4,3,1,""],AccountingDecoder:[4,3,1,""]},"accounting.storage.sql.models":{Amount:[0,3,1,""],Transaction:[0,3,1,""],Posting:[0,3,1,""]},"accounting.storage.Storage":{get_transaction:[2,1,1,""],get_account:[2,1,1,""],reverse_transaction:[2,1,1,""],update_transaction:[2,1,1,""],get_transactions:[2,1,1,""],add_transaction:[2,1,1,""],delete_transaction:[2,1,1,""],get_accounts:[2,1,1,""]},"accounting.storage.ledgercli":{main:[2,5,1,""],Ledger:[2,3,1,""]},"accounting.exceptions":{AccountingException:[4,4,1,""]},"accounting.transport.AccountingDecoder":{dict_to_object:[4,1,1,""]}},titleterms:{titl:[],decor:4,api:[3,1],depend:3,sql:0,content:[0,4,2],gtk:3,storag:[0,2],instal:3,usag:3,welcom:1,setup:3,model:[0,4],submodul:[0,4,2],test:[],web:4,config:4,ledgercli:2,ubuntu:3,modul:[0,4,2],gtkclient:4,indic:1,tabl:1,subpackag:[4,2],client:[3,4],develop:3,transport:4,packag:[0,4,2],account:[0,1,2,3,4,5],document:1,except:4,asyncio:[]},objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","attribute","Python attribute"],"3":["py","class","Python class"],"4":["py","exception","Python exception"],"5":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:method","2":"py:attribute","3":"py:class","4":"py:exception","5":"py:function"},envversion:43,titles:["accounting.storage.sql package","Welcome to Accounting API’s documentation!","accounting.storage package","The Accounting API","accounting package","accounting"],filenames:["api/accounting.storage.sql","index","api/accounting.storage","README","api/accounting","api/modules"],terms:{core:3,code:3,contextlib:2,name:4,would:3,sql:[],need:3,incom:4,send_command:2,json:4,within:2,func:4,load:2,found:2,app:[0,2],stdin:2,run:[3,2],argument:2,apt:3,virtualenv:3,jsonify_except:4,yield:2,path:[3,4],parse_json:[],search:1,index:[1,4],method:[3,4,2],amount_id:0,separ:4,handl:2,"_generate_id":4,accountingdecod:4,your:3,should:2,accountingexcept:[4,2],take:[4,2],initi:4,describ:3,section:3,git:3,indicate_activity_don:4,page:1,evalu:2,databas:2,fals:4,"return":[4,2],exampl:[],regist:3,update_transact:[0,2],sort_kei:4,well:3,high:4,make:3,net:3,karma:[],process:2,ensure_ascii:4,ledgercli:[],add_transact:[0,2],version:3,remov:2,npoacct:3,linebreak:[],skipkei:4,statement:2,contextmanag:2,termin:3,simple_transact:4,get_transact:[0,2],context:2,manag:2,debug:[],mkvirtualenv:3,"class":[0,4,2],arg:[0,2],anoth:3,serial:4,balanc:3,mbudd:3,prog:4,unlock:2,instanc:2,payload:4,accountingencod:4,print_transact:4,ledger:[3,4,2],uuid:0,transaction_upd:4,usr:3,get_bal:4,etc:3,blah:[],builtin:[4,2],work:3,request:4,date:[0,4],head:3,ledger_process:2,data:[],x20:2,argv:[4,2],init_process:2,until:2,gitori:3,on_about_dialog_respons:4,logic:4,symbol:[3,0,4],get_account:2,from:[3,2],kindli:4,output:[4,2],get_process:2,jsondecod:4,sourc:[3,0,4,2],transaction_id:[4,2],webservic:4,decod:[],self:2,sudo:3,check_circular:4,current:4,onc:2,currenc:3,"default":4,mean:3,func_or_str:4,python:3,state:4,site:3,donat:4,contain:4,"try":3,environ:3,file:[4,2],usd:3,type:[],simpl:3,balance_report:[],tri:3,post:[0,4],how:3,you:3,januari:3,doe:3,flask_sqlalchemi:0,on_transaction_refresh_activ:4,base:[0,4,2],local:3,creat:2,locked_process:2,metadata:4,"function":3,amount:[0,4],irc:3,banner:2,bound:2,transaction_uuid:0,sinc:2,transaction_delet:4,ppa:3,caller:4,asset:[3,4],conserv:3,pip:3,follow:3,txt:3,annot:4,which:[3,4,2],assemble_argu:2,delet:2,shell:3,check:[3,4,2],requir:[3,4],text:2,"catch":4,insert:3,becom:4,pars:[],sai:3,from_acc:4,ledger_bin:2,discard:2,add:[3,2],on_aboutdialog_clos:[],expens:3,rest:4,recommend:2,wget:[],load_ui:4,out:3,open:2,curl:[],purpos:3,set:[3,2],response_typ:4,combin:2,abc:2,init_ledg:4,before_request:4,subprocess:2,storag:[],main:[4,2],boundari:2,without:2,old:2,avaiabl:3,thi:[3,4,2],ledger_fil:[3,2],transactionnotfound:2,meta:0,json_encod:4,suitabl:2,popen:2,flag:3,get:[3,4],via:[3,4],accountingappl:4,bal:2,generate_id:4,presum:2,pass:2,allow_nan:4,bin:3,servic:3,back:2,want:3,on_transactions_load:4,delete_transact:2,when:2,system:3,freenod:3,json_decod:4,autodetect:3,alreadi:2,list:2,print_balance_account:4,content:[],on_show_about_activ:4,on_transaction_select:[],line:2,channel:3,flask:[3,4],clone:3,to_acc:4,virtualenvwrapp:3,sqlstorag:0,on_refresh_transactions_activ:[],below:3,"__type__":4,transaction_post:4,execut:2,memori:2,applic:[],can:[3,2],serv:3,repositori:3,register_report:[],lock:2,see:3,user:3,ani:4,report:3,also:3,host:4,object:[4,2],end:3,yet:3,accountin:[],transact:[3,0,4,2],paye:[0,4],mode:2,all:[3,2],jsonencod:4,wrap:4,runtimeerror:2,clariti:[],org:3,reg:[4,2],python3:3,none:[0,4,2],command:2,went:3,read_until_prompt:2,http:[],reverse_transact:2,write:[4,2],donor:4,as_dict:0,rent:3,endpoint:4,get_regist:4,"true":[4,2],widget:4,level:4,hello:4,setup:[],have:3,look:2,world:4,foo:4,prompt:[3,2],workon:3,read:2,indicate_act:4,kwarg:0,result:2,dict_to_object:4,on_transaction_view_cursor_chang:4,"new":2,transaction_get:4,updat:[3,2],indent:4,them:2,find:2,log:3}}) \ No newline at end of file +Search.setIndex({envversion:43,titles:["accounting","accounting.storage package","accounting.storage.sql package","The Accounting API","accounting package","Welcome to Accounting API’s documentation!","REST API"],objtypes:{"0":"http:get","1":"http:delete","2":"http:post","3":"py:module","4":"py:function","5":"py:class","6":"py:method","7":"py:exception","8":"py:attribute"},filenames:["api/modules","api/accounting.storage","api/accounting.storage.sql","README","api/accounting","index","restapi"],terms:{you:[3,6],manag:1,requir:[3,4],http:6,string:6,print_transact:4,app:[2,1],transaction_upd:4,"class":[2,4,1],parse_json:[],pass:1,alreadi:1,ani:4,site:3,remov:1,contextmanag:1,unlock:1,register_report:[],channel:3,databas:1,setup:[],object:[4,6,1],indicate_act:4,json_decod:4,serial:4,clariti:[],load:1,symbol:[2,3,4,6],on_show_about_activ:4,invoice20100101:6,user:3,base:[2,4,1],them:1,state:4,jsonencod:4,wget:[],mind:6,caller:4,file:[4,1],on_transaction_view_cursor_chang:4,mean:3,before_request:4,apt:3,environ:3,json:[4,6],bal:1,delet:1,handl:1,your:3,should:1,kwarg:2,main:[4,1],result:1,runtimeerror:1,sinc:1,transaction_id:[4,6,1],high:4,response_typ:4,current:4,rent:3,describ:3,how:3,repositori:3,on_transactions_load:4,delete_transact:1,have:3,currenc:3,run:[3,1],payload:4,search:5,record:6,amount_id:2,bin:3,applic:6,januari:3,argument:1,dict_to_object:4,exampl:6,regist:3,fals:4,karma:[],gitori:3,sai:3,donat:[4,6],jsonify_except:4,prompt:[3,1],from:[3,1],autodetect:3,"function":3,hello:4,on_refresh_transactions_activ:[],statement:1,execut:1,well:3,onc:1,content:[],anyth:6,update_transact:[2,1],jsondecod:4,virtualenvwrapp:3,indicate_activity_don:4,method:[3,4,1],log:3,add_transact:[2,1],sqlstorag:2,npoacct:3,on_transaction_refresh_activ:4,lock:1,report:3,name:4,arrai:6,ensure_ascii:4,read_until_prompt:1,read:1,paye:[2,4,6],find:1,list:[6,1],on_aboutdialog_clos:[],check:[3,4,6,1],prog:4,need:3,meta:2,boundari:1,command:1,accept:6,separ:4,linebreak:[],generate_id:4,accountingexcept:[4,1],expens:3,freenod:3,on_transaction_select:[],can:[3,6,1],balance_report:[],servic:3,out:3,respons:6,arg:[2,1],world:4,code:3,statu:6,blah:[],back:1,flask:[3,4],balanc:3,wrap:4,sourc:[2,3,4,1],transaction_uuid:2,via:[3,4],system:3,send_command:1,irc:3,indent:4,func:4,evalu:1,decod:[],git:3,from_acc:4,mode:1,want:3,level:4,shell:3,on_about_dialog_respons:4,abc:1,data:[],anoth:[3,6],request:[4,6],date:[2,4,6],discard:1,follow:3,old:1,ledger:[3,4,1],when:1,host:[4,6],webservic:4,avaiabl:3,context:1,banner:1,usd:3,"try":3,asset:[3,4,6],workon:3,page:5,contain:4,bound:1,"catch":4,until:1,subprocess:1,found:1,transaction_get:4,clone:3,tri:3,stdin:1,net:3,usr:3,transaction_post:4,accountingencod:4,ledger_process:1,logic:4,foo:[4,6],func_or_str:4,head:3,wxampl:[],"new":1,skipkei:4,look:1,locked_process:1,builtin:[4,1],sudo:3,python3:3,local:3,process:1,ppa:3,"return":[4,1],becom:4,curl:[],pdf:6,metadata:[4,6],line:1,serv:3,simpl:3,insert:3,transactionnotfound:1,suitabl:1,core:3,conserv:3,donor:[4,6],accountingappl:4,sort_kei:4,thi:[3,4,1],check_circular:4,transact:[2,3,4,1],accountin:[],python:3,to_acc:4,combin:1,also:3,section:3,mkvirtualenv:3,creat:1,"default":4,org:3,get_account:1,see:3,end:3,init_process:1,collid:6,make:3,type:6,all:[3,6,1],endpoint:4,ledger_fil:[3,1],json_encod:4,rest:4,set:[3,1],load_ui:4,uuid:2,get_transact:[2,1],none:[2,4,1],mbudd:3,annot:4,get_regist:4,pip:3,sql:[],earmark:6,"true":[4,1],storag:[],below:3,accountingdecod:4,"__type__":[4,6],purpos:3,contextlib:1,instanc:1,index:[5,4],debug:[],write:[4,1],init_ledg:4,initi:4,thei:6,went:3,txt:[3,6],add:[3,1],kindli:[4,6],which:[3,4,1],take:[4,1],as_dict:2,pars:[],virtualenv:3,flask_sqlalchemi:2,work:3,version:3,memori:1,argv:[4,1],recommend:1,yield:1,within:1,project:6,ledger_bin:1,etc:3,reg:[4,1],transaction_delet:4,get_bal:4,without:1,text:1,path:[3,4],incom:[4,6],termin:3,flag:3,popen:1,invoic:6,approv:6,x20:1,allow_nan:4,open:1,doe:3,presum:1,get:[3,4],get_process:1,post:[2,4,6],output:[4,1],paramet:6,yet:3,"_generate_id":4,widget:4,self:1,updat:[3,1],ledgercli:[],print_balance_account:4,amount:[2,4,6],assemble_argu:1,simple_transact:4,reverse_transact:1,would:3},objnames:{"0":["http","get","HTTP get"],"1":["http","delete","HTTP delete"],"2":["http","post","HTTP post"],"3":["py","module","Python module"],"4":["py","function","Python function"],"5":["py","class","Python class"],"6":["py","method","Python method"],"7":["py","exception","Python exception"],"8":["py","attribute","Python attribute"]},objects:{"":{accounting:[4,3,0,"-"],"/transaction":[6,2,1,"post--transaction"],"/transaction/":[6,1,1,"delete--transaction--string-transaction_id-"]},"accounting.gtkclient":{indicate_activity_done:[4,4,1,""],indicate_activity:[4,4,1,""],main:[4,4,1,""],AccountingApplication:[4,5,1,""]},"accounting.storage.sql.SQLStorage":{add_transaction:[2,6,1,""],update_transaction:[2,6,1,""],get_transactions:[2,6,1,""]},"accounting.web":{index:[4,4,1,""],transaction_update:[4,4,1,""],transaction_post:[4,4,1,""],transaction_delete:[4,4,1,""],init_ledger:[4,4,1,""],transaction_get:[4,4,1,""],main:[4,4,1,""]},"accounting.storage.ledgercli":{Ledger:[1,5,1,""],main:[1,4,1,""]},"accounting.client":{print_balance_accounts:[4,4,1,""],print_transactions:[4,4,1,""],main:[4,4,1,""],Client:[4,5,1,""]},"accounting.transport":{AccountingDecoder:[4,5,1,""],AccountingEncoder:[4,5,1,""]},"accounting.transport.AccountingEncoder":{"default":[4,6,1,""]},"accounting.storage.Storage":{get_accounts:[1,6,1,""],add_transaction:[1,6,1,""],get_transaction:[1,6,1,""],update_transaction:[1,6,1,""],get_account:[1,6,1,""],delete_transaction:[1,6,1,""],get_transactions:[1,6,1,""],reverse_transaction:[1,6,1,""]},"accounting.gtkclient.AccountingApplication":{on_show_about_activate:[4,6,1,""],on_transaction_refresh_activate:[4,6,1,""],on_transaction_view_cursor_changed:[4,6,1,""],on_transactions_loaded:[4,6,1,""],load_ui:[4,6,1,""],on_about_dialog_response:[4,6,1,""]},"accounting.decorators":{jsonify_exceptions:[4,4,1,""]},"accounting.storage.sql.models.Posting":{transaction:[2,8,1,""],amount_id:[2,8,1,""],as_dict:[2,6,1,""],id:[2,8,1,""],transaction_uuid:[2,8,1,""],account:[2,8,1,""],meta:[2,8,1,""],amount:[2,8,1,""]},"accounting.exceptions":{AccountingException:[4,7,1,""]},accounting:{exceptions:[4,3,0,"-"],storage:[1,3,0,"-"],client:[4,3,0,"-"],web:[4,3,0,"-"],config:[4,3,0,"-"],models:[4,3,0,"-"],gtkclient:[4,3,0,"-"],transport:[4,3,0,"-"],decorators:[4,3,0,"-"]},"accounting.models":{Transaction:[4,5,1,""],Account:[4,5,1,""],Posting:[4,5,1,""],Amount:[4,5,1,""]},"accounting.storage.ledgercli.Ledger":{reg:[1,6,1,""],add_transaction:[1,6,1,""],assemble_arguments:[1,6,1,""],init_process:[1,6,1,""],locked_process:[1,6,1,""],bal:[1,6,1,""],get_process:[1,6,1,""],get_transactions:[1,6,1,""],read_until_prompt:[1,6,1,""],get_transaction:[1,6,1,""],delete_transaction:[1,6,1,""],send_command:[1,6,1,""],update_transaction:[1,6,1,""]},"accounting.storage.sql.models.Amount":{symbol:[2,8,1,""],id:[2,8,1,""],as_dict:[2,6,1,""],amount:[2,8,1,""]},"accounting.client.Client":{get:[4,6,1,""],get_balance:[4,6,1,""],simple_transaction:[4,6,1,""],get_register:[4,6,1,""],post:[4,6,1,""]},"accounting.storage.sql.models":{Transaction:[2,5,1,""],Posting:[2,5,1,""],Amount:[2,5,1,""]},"accounting.storage":{sql:[2,3,0,"-"],ledgercli:[1,3,0,"-"],Storage:[1,5,1,""],TransactionNotFound:[1,7,1,""]},"accounting.storage.sql":{models:[2,3,0,"-"],SQLStorage:[2,5,1,""]},"accounting.transport.AccountingDecoder":{dict_to_object:[4,6,1,""]},"accounting.storage.sql.models.Transaction":{meta:[2,8,1,""],as_dict:[2,6,1,""],id:[2,8,1,""],payee:[2,8,1,""],uuid:[2,8,1,""],date:[2,8,1,""]},"accounting.models.Transaction":{generate_id:[4,6,1,""]}},titleterms:{welcom:5,asyncio:[],sql:2,setup:3,modul:[2,4,1],config:4,ubuntu:3,titl:[],test:[],delet:6,transport:4,packag:[2,4,1],usag:3,except:4,tabl:5,document:5,ledgercli:1,gtkclient:4,instal:3,indic:5,depend:3,decor:4,subpackag:[4,1],storag:[2,1],client:[3,4],model:[2,4],submodul:[2,4,1],gtk:3,content:[2,4,1],rest:6,get:6,web:4,transact:6,account:[1,2,5,0,3,4],api:[3,5,6],develop:3,add:6}}) \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index a8be22b901e1bc2a477d457b1ba53b1ef80cb5d7..2703ba5e8a3ca2b93210e35946fe87da527c0478 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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'] diff --git a/doc/source/index.rst b/doc/source/index.rst index d8e58a77516450013ab3230143e7c75319f88ba3..0a00f06f527ecc9d48fd8eabcd35682dec7e6134 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -12,6 +12,7 @@ Contents: :maxdepth: 2 README + restapi api/accounting.rst diff --git a/doc/source/restapi.rst b/doc/source/restapi.rst new file mode 100644 index 0000000000000000000000000000000000000000..42b799839e3d338dc61a945167a716a4d54cb5e5 --- /dev/null +++ b/doc/source/restapi.rst @@ -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/ + + 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" + }