Python script that reads a ledger and gets the account balance for a given user and for a specific date.
- Docker (https://www.docker.com)
$ docker-compose build
$ docker-compose up -d
$ docker exec -ti pyledger-app sh
Run the python REPL and use the following example:
from src.ledger import Ledger
ledger = Ledger('data/ledger.csv')
# get account balance for an account id to current date
ledger.get_account_balance('john')
# get account balance for an account id for a certain day
ledger.get_account_balance('mary', '2015-01-24')
From the docker shell (docker exec -ti pyledger-app sh
) run the following command:
py.test