Ledgercalc
multifunction + variables RPN calculator for ledger
Install / Use
/learn @zdw/LedgercalcREADME
ledgercalc
A simple multifunction + variables RPN calculator for Ledger (http://www.ledger-cli.org)
Works with Ledger 3 when compiled with the python interface
Must be run via ledger python ledgercalc.py <journalfile> start_year end_year <commandfile>...
An example is included, run it with:
ledger python ledgercalc.py example.lgr 2012 2014 example.commands
Syntax
Syntax is RPN, so an operation like
account1 account2 +
adds two accounts, pushes result onto stack.
Accounts containing spaces/regex must be put in double quotes.
Variables are prefixed with $, and are assigned like this:
$taxrate 0.091 =
Numbers are bare, but amounts less than decimals have to be preceded by a 0 (good: 0.15, bad: .15)
Comments start with #
Output
Output is a list of all variables assigned during each run in varname = <amount> format
Known Bugs
Currently only supports the USD currency.
Account regex parsing isn't the same as ledger, due to the way the python interface works.
Change History
2015-12-12: Added exception handling, additional usd/subz commands to force currency conversion, or a zero bounded subtraction, changed order of cli variables to allow multiple command files
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
