hledger-interest: computes interest for a given account
hledger-interest is a small command-line utility based on Simon Michael's hledger library. Its purpose is to compute interest for a given ledger account. Using command line flags, the program can be configured to use various schemes for day-counting, such as act/act, 30/360, 30E/360, and 30/360isda. Furthermore, it supports a (small) number of interest schemes, i.e. annual interest with a fixed rate and the scheme mandated by the German BGB288 (Basiszins fuer Verbrauchergeschaefte). Extending support for other schemes is fairly easy, but currently requires changes to the source code.
As an example, consider the following loan, stored in a file called
test.ledger:
2008/09/26 Loan
Assets:Bank EUR 10000.00
Liabilities:Bank
2008/11/27 Payment
Assets:Bank EUR -3771.12
Liabilities:Bank
2009/05/03 Payment
Assets:Bank EUR -1200.00
Liabilities:Bank
2010/12/10 Payment
Assets:Bank EUR -3700.00
Liabilities:BankSuppose that loan earns 5% interest per year, and payments amortize interest before amortizing the principal claim, then the resulting ledger would look like this:
$ hledger-interest --file=test.ledger --source=Expenses:Interest --target=Liabilities:Bank --30-360 --annual=0.05 Liabilities:Bank
2008-09-26 Loan
Assets:Bank EUR 10000.00
Liabilities:Bank EUR -10000.00
2008-11-27 5% interest for EUR -10000.00 over 61 days
Liabilities:Bank EUR -84.72
Expenses:Interest EUR 84.72
2008-11-27 Payment
Assets:Bank EUR -3771.12
Liabilities:Bank EUR 3771.12
2008-12-31 5% interest for EUR -6313.60 over 34 days
Liabilities:Bank EUR -29.81
Expenses:Interest EUR 29.81
2009-05-03 5% interest for EUR -6343.42 over 123 days
Liabilities:Bank EUR -108.37
Expenses:Interest EUR 108.37
2009-05-03 Payment
Assets:Bank EUR -1200.00
Liabilities:Bank EUR 1200.00
2009-12-31 5% interest for EUR -5251.78 over 238 days
Liabilities:Bank EUR -173.60
Expenses:Interest EUR 173.60
2010-12-10 5% interest for EUR -5425.38 over 340 days
Liabilities:Bank EUR -256.20
Expenses:Interest EUR 256.20
2010-12-10 Payment
Assets:Bank EUR -3700.00
Liabilities:Bank EUR 3700.00Running the utility with --help gives a brief overview over the
available options:
Usage: hledger-interest [OPTION...] ACCOUNT
-h --help print this message and exit
-V --version show version number and exit
-v --verbose echo input ledger to stdout (default)
-q --quiet don't echo input ledger to stdout
--today compute interest up until today
--post-on-transactions post interest only when the balance changes
(and with --today), not at the end of
every year or rate period
-f FILE --file=FILE input ledger file (pass '-' for stdin)
default: $LEDGER_FILE or ~/.hledger.journal
-s ACCOUNT --source=ACCOUNT interest source account
-t ACCOUNT --target=ACCOUNT interest target account
-I --ignore-assertions ignore any failing balance assertions
--act use 'act/act' day counting convention
(Actual/Actual ISDA; see README)
--30-360 use '30/360' day counting convention
--30E-360 use '30E/360' day counting convention
--30E-360isda use '30E/360isda' day counting convention
--constant=RATE constant interest rate
--annual=RATE annual interest rate
--annual-schedule=SCHEDULE schedule of annual interest rates.
syntax: '[(Date1,Rate1),(Date2,Rate2),...]'
--bgb288 compute interest according to German BGB288
--db24 HACK: Deutsche Bank 24
--ing-diba HACK: compute interest according for Ing-Diba Tagesgeld account
[Skip to Readme]
Downloads
- hledger-interest-1.7.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 1.0, 1.1, 1.2, 1.3, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.7.0, 2.0.0 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | base (>=3 && <5), Decimal, hledger-lib (>=1.26 && <1.53), mtl, text, time [details] |
| Tested with | ghc ==9.6.7, ghc ==9.8.4, ghc ==9.10.3, ghc ==9.12.2, ghc ==9.14.1 |
| License | BSD-3-Clause |
| Author | Peter Simons <simons@cryp.to> |
| Maintainer | Peter Simons <simons@cryp.to> |
| Uploaded | by PeterSimons at 2026-11-11T08:56:52Z |
| Category | Finance |
| Home page | https://github.com/peti/hledger-interest |
| Source repo | head: git clone https://github.com/peti/hledger-interest.git |
| Distributions | LTSHaskell:1.6.7, Stackage:2.0.0 |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Executables | hledger-interest |
| Downloads | 14831 total (90 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs not available [build log] Last success reported on 2026-11-11 [all 1 reports] |