Go to file
2024-05-11 20:06:40 -07:00
src changed payment_number to payment-number; fixed one-time payments not counting 2024-05-11 20:06:40 -07:00
Makefile changed payment_number to payment-number; fixed one-time payments not counting 2024-05-11 20:06:40 -07:00
README.md changed payment_number to payment-number; fixed one-time payments not counting 2024-05-11 20:06:40 -07:00

amort

Generates an amortization schedule based on the principal, interest rate, term, and any additional payments towards principal.

requirements

Only imports argparse and json for the main block of the script.

  • saves results to a file schedule.csv
  • does not access the web or internet

usage

Invoke make test to generate a schedule based on loan of 100,000 over a 3 year term given an interest rate of 5.0% with a one-time payment towards principal of 5000 at the 13th month.

extra payments

For extra payments towards principal, invoking the script will look like:

python src/amort.py -p {principal} -i {interest rate} -t {years} --extra-payments extra_payments.json

A valid json file contains an list named extra-payments. Each element is an object with the attributes payment-number and amount.

{
    "extra-payments" : [
        {
            "payment-number": 1,
            "amount": 500
        }, {
            "payment-number": 2,
            "amount": 500
        }, {
            "payment-number": 3,
            "amount": 500
        }
    ]
}
  • payment-number is the month when the payment has been made.
  • amount is self-explanatory

misc

This originated from me playing with ChatGPT. I asked it a question and it blurted out a semi-functional script as an answer. Then I made this repo to track the errors I fixed.