from bareaccount import Journal
j = Journal.journal('leadger')
account = j.createJournal('myjournal',drop=False)
j.show(account)
Journal 'myjournal' Created.
Empty DataFrame
Columns: [ID, credit, debit, balance]
Index: []
j.transaction(account,12,2)
j.show(account)
ID credit debit balance
0 1 12.0 2.0 10.0
# 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
print(j.listJournals())
['myjournal']
[j.deleteJournal(x) for x in j.listJournals()]
Journal 'myjournal' deleted.
[None]