jgera / bare-account

basic double entry accounting system in python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bare Account: simple double entry journaling liberary for python with SQLite backend

from bareaccount import Journal

Create an dataset

j = Journal.journal('leadger') 

Create an empty journal and show it

account = j.createJournal('myjournal',drop=False)
j.show(account)
Journal 'myjournal' Created.
Empty DataFrame
Columns: [ID, credit, debit, balance]
Index: []

Create a transaction and show the journal

j.transaction(account,12,2)
j.show(account)
   ID  credit  debit  balance
0   1    12.0    2.0     10.0

get balance of journal

# insert transactions into the journal
import random
for i in range(5):
    debit = random.randint(1,100)   
    credit = random.randint(1,100)
    j.transaction(account,credit,0)
    j.transaction(account,0,debit)

j.show(account)
    ID  credit  debit  balance
0    1    12.0    2.0     10.0
1    2    19.0    0.0     29.0
2    3     0.0   60.0    -31.0
3    4    40.0    0.0      9.0
4    5     0.0   84.0    -75.0
5    6    82.0    0.0      7.0
6    7     0.0    4.0      3.0
7    8    31.0    0.0     34.0
8    9     0.0    5.0     29.0
9   10    37.0    0.0     66.0
10  11     0.0   39.0     27.0
j.getbalance(account)
27.0

list accounting journals

print(j.listJournals())
['myjournal']
[j.deleteJournal(x) for x in j.listJournals()]
Journal 'myjournal' deleted.
[None]

About

basic double entry accounting system in python


Languages

Language:Jupyter Notebook 74.8%Language:Python 25.2%