This is a small collection of utility scripts to help managing ledger-cli data.
transactionsorter
, pricedbfetcher
, and questrademain
are written in Go. Download a copy of the Go compiler, and run ./build.sh
.
Usage: ./transactionsorter <file>
.
This sorts a file full of Ledger transactions by date, in-place. A compelling use-case is for importing multiple CSV files (using icsv2ledger, for example) into the same transactions file.
Although ledger does somewhat support having per-account transaction files, which would somewhat lessen the value of this use-case, but this is widely acknowledged to break balance assertions.
Note that this tool is currently quite limited - it only understands basic transaction syntax and comments, and could fail if other ledger directives are in the file.
Usage: ./pricedbtocsv [-close-time=<time in '22:45:00' format>] [-price-db-file=<path>]
As the name suggests, this tool converts a ledger-cli price-db file (see here for more details) into CSV data. The CSV data is printed to stdout, so you may want to redirect it to a file.
Mostly just for testing the Questrade API.
networthbyday.py computes a one-row-per-day CSV file of total Assets minus total Liabilities.
Usage: misc/networthbyday.py --start_date=YYYY-MM-DD --end_date=YYYY-MM-DD
. The output is printed to stdout, so you may want to redirect it to a file.
This one probably should just be an alias.