Update readme. Refactor toldg a little. Provide example files for testing by the user.
This commit is contained in:
44
example/Makefile
Normal file
44
example/Makefile
Normal file
@@ -0,0 +1,44 @@
|
||||
PY?=python3
|
||||
LEDGER=hledger
|
||||
TOLDG=$(PY) ../toldg.py
|
||||
GETOFX=$(PY) ../getofx.py
|
||||
|
||||
TOLDG_CONFIG=configs/toldg.json
|
||||
GETOFX_CONFIG=configs/getofx.json
|
||||
LEDGER_FILES=$(wildcard processed/*.ldg)
|
||||
OUTPUTDIR=processed
|
||||
LEDGER_ALL=result.ldg
|
||||
|
||||
all: toldg merge
|
||||
|
||||
help:
|
||||
@echo 'Makefile for Ledger automation '
|
||||
@echo ' '
|
||||
@echo 'Usage: '
|
||||
@echo ' make getofx download ofx data and write to CSV '
|
||||
@echo ' make toldg transform CSV files into LDG files '
|
||||
@echo ' make merge merge all ldg files into one '
|
||||
@echo ' make bs show hledger balance '
|
||||
@echo ' make ui open hledger-ui in tree view '
|
||||
@echo ' make clean remove ledger files from output dir'
|
||||
@echo ' '
|
||||
|
||||
getofx:
|
||||
@$(GETOFX) $(GETOFX_CONFIG)
|
||||
|
||||
toldg:
|
||||
@$(TOLDG) $(TOLDG_CONFIG)
|
||||
|
||||
merge:
|
||||
@cat $(LEDGER_FILES) > $(LEDGER_ALL)
|
||||
|
||||
bs:
|
||||
@echo ""
|
||||
@$(LEDGER) bs -V --depth 2 -f $(LEDGER_ALL)
|
||||
|
||||
ui:
|
||||
hledger-ui -V --tree --depth 2 -f $(LEDGER_ALL)
|
||||
|
||||
clean:
|
||||
@[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)/*
|
||||
|
||||
Reference in New Issue
Block a user