Python library for calculating amortizations and generating amortization schedules
Project description
amortization
Python library for calculating amortizations and generating amortization schedules
License | Version | ||
Github Actions | Coverage | ||
Supported versions | Wheel | ||
Status | Downloads |
Support
If you like amortization
or if it is useful to you, show your support by buying me a coffee.
Installation
pip install amortization
Usage
Python
Amortization Amount
from amortization.amount import calculate_amortization_amount
amount = calculate_amortization_amount(150000, 0.1, 36)
Amortization Period
from amortization.period import calculate_amortization_period
period = calculate_amortization_period(150000, 0.1, 4840.08)
Amortization Schedule
from amortization.schedule import amortization_schedule
for number, amount, interest, principal, balance in amortization_schedule(150000, 0.1, 36):
print(number, amount, interest, principal, balance)
Amortization Schedule (using tabulate)
from amortization.schedule import amortization_schedule
from tabulate import tabulate
table = (x for x in amortization_schedule(150000, 0.1, 36))
print(
tabulate(
table,
headers=["Number", "Amount", "Interest", "Principal", "Balance"],
floatfmt=",.2f",
numalign="right"
)
)
Command line
amortize -h
usage: amortize [-h] -P PRINCIPAL -r INTEREST_RATE [-s] (-n PERIOD | -a AMOUNT)
Python library for calculating amortizations and generating amortization schedules
options:
-h, --help show this help message and exit
-s, --schedule Generate amortization schedule
-n PERIOD, --period PERIOD
Total number of periods
-a AMOUNT, --amount AMOUNT
Amortization amount per period
required arguments:
-P PRINCIPAL, --principal PRINCIPAL
Principal amount
-r INTEREST_RATE, --interest-rate INTEREST_RATE
Interest rate per period
amortize -P 150000 -n 36 -r 0.1 # period
amortize -P 150000 -n 36 -r 0.1 -s # period
amortize -P 150000 -a 4840.08 -r 0.1 # amount
Dependencies
Author
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
amortization-2.0.0.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for amortization-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bab99dc3fc43b50a3c83479efc03e56fe118f642d4c48b192087612bef2d15c3 |
|
MD5 | 7b9fcb3655d5771271849a3da0975d6e |
|
BLAKE2b-256 | d31d6e40555b02d5690e2ffc78a4996a0cf0855553afdef3b7646c750f251570 |