https://github.com/bilbottom/loan-calcs
Library for common loan calculations.
https://github.com/bilbottom/loan-calcs
Last synced: about 1 year ago
JSON representation
Library for common loan calculations.
- Host: GitHub
- URL: https://github.com/bilbottom/loan-calcs
- Owner: Bilbottom
- Created: 2024-06-23T19:06:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-12T07:36:40.000Z (about 1 year ago)
- Last Synced: 2025-04-24T02:04:47.780Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 227 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://www.python.org/downloads/)
[](https://github.com/Bilbottom/loan-calcs/actions/workflows/tests.yaml)
[](https://github.com/dbrgn/coverage-badge)
[](https://shields.io/badges/git-hub-last-commit)
[](https://github.com/prettier/prettier)
[](https://github.com/astral-sh/ruff)
[](https://results.pre-commit.ci/latest/github/Bilbottom/loan-calcs/main)
---
# Loan Calculations
Library for common loan calculations.
## Notation
A _loan_ is a fixed value of money borrowed by an entity and usually repaid over a series of instalments.
The following notation is used throughout this project for loans:
- `L`: Loan amount
- `R`: Periodic interest rate
- `N`: Total number of repayments
- `P_n`: Total periodic repayment value at period `n`
- `P_{P, n}`: The principal part of the periodic repayment value at period `n`
- `P_{I, n}`: The interest part of the periodic repayment value at period `n`
- `b`: Whether the interest is applied before or after the repayment
- `B_n`: The balance on the loan at period `n`
The repayment for a loan, `P_n`, is split into two parts:
- The _principal_ part, `P_{P, n}`, which is paying off the original money that was borrowed.
- The _interest_ part, `P_{I, n}`, which is paying off the interest applied on the loan.
In 'real life', a loan can have other components such as fees. These are outside the scope of this project.
## Calculations
Many of the properties are calculated analytically. The calculations are described in the [`tex/proofs.pdf`](tex/proofs.pdf) file.