larzloan
Interest and amortization, Money-aware throughout.
Simple and compound interest, a real monthly-payment formula, and a full amortize() schedule - one row per period with the payment/interest/principal split and running balance. Every value is the language's exact Money type, so a schedule that should reach zero actually does.
larzscript pkg install loan
What you get
- Simple + compound interest
- Real monthly-payment (amortization) formula
- Full amortize() schedule, period by period
- Exact Money throughout - a schedule actually reaches zero
Try it
import "loan" as loan
print(loan.simple_interest($1000.00, 0.05, 2))
print(loan.compound_interest($1000.00, 0.05, 12, 2))
let schedule = loan.amortize($10000.00, 0.06, 3)
for row in schedule { print(row["period"], row["payment"], row["interest"], row["balance"]) }Output
$100.00 $104.94 1 $3366.72 $50.00 $6683.28 2 $3366.72 $33.42 $3349.98 3 $3366.72 $16.75 $0.01
Why it's in the Larz Stack
larzloan is a real Larzscript package (larzscript pkg install loan) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.