ledger-tools

module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2026 License: MIT

README

ledger-tools

This is a small collection of utility scripts to help managing ledger-cli data.

Building

transactionsorter, pricedbfetcher, and questrademain are written in Go. Download a copy of the Go compiler, and run ./build.sh.

Or, better yet, install Nix and build with nix build.

transactionsorter

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.

pricedbfetcher

See pricedbfetcher README.

pricedbtocsv

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.

questrademain

Mostly just for testing the Questrade API.

pricedbmain

Usage: ./pricedbmain [--close-time=<time in '22:45:00' format>] [--price-db-path=<path>] [--output-type=<"json"|"proto-text"|"proto-wire">]

This utility parses the price-db file, converts it into a slice of TimeSeriesItemWithSymbol, and then outputs it in a protocol buffer format for storage or consumption by other programs.

networthbyday

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.

regcsv

This one probably should just be an alias.

Directories

Path Synopsis
src
fs
Package fs is a wrapper around the `afero` package to make testing easy.
Package fs is a wrapper around the `afero` package to make testing easy.
pricedbfetcher command
pricedbmain command
pricedbtocsv command
questrademain command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL