Mortgage Calculator
Project description
Mortgage
Mortgage is a simple calculator intended to aid comprehension of the true cost of a mortgage.
Installation
To install mortgage, simply:
pip install mortgage
Documentation
Documentation is available at https://mortgage.readthedocs.io
How To Use
This package is intended to help understand the true cost of a mortgage. It also can help you easily compare between different mortgages.
Begin by importing the loan class
from mortgage import Loan
Create a simple mortgage
from mortgage import Loan
loan = Loan(principal=200000, interest=.06, term=30)
View a summary of pertinent mortgage information by calling the summarize property.
from mortgage import Loan
loan = Loan(principal=200000, interest=.06, term=30)
loan.summarize
>>> Original Balance: $ 200,000
>>> Interest Rate: 0.06 %
>>> APY: 6.17 %
>>> APR: 6.00 %
>>> Term: 30 years
>>> Monthly Payment: $ 1199.10
>>> Total principal payments: $ 200,000.00
>>> Total interest payments: $ 231,676.38
>>> Total payments: $ 431,676.38
>>> Interest to principal: 115.8 %
>>> Years to pay: 30.0
Particularly telling is the Interest to Principal ratio. With the mortgage terms above, you will pay 115% of the original balance in interest! Compare that to the same loan with a 15 year term below
from mortgage import Loan
loan = Loan(principal=200000, interest=.06, term=15)
loan.summarize
>>> Original Balance: $ 200,000
>>> Interest Rate: 0.06 %
>>> APY: 6.17 %
>>> APR: 6.00 %
>>> Term: 15 years
>>> Monthly Payment: $ 1687.71
>>> Total principal payments: $ 200,000.00
>>> Total interest payments: $ 103,788.46
>>> Total payments: $ 303,788.46
>>> Interest to principal: 51.9 %
>>> Years to pay: 15.0
In this case, you only pay 52% of the original loan balance in interest. Obviously, the shorter the term with all else equal, the less interest you'll pay. But it helps to know exactly how much more/less you'll pay.
Run The Test Cases
From the top level directory, run the following command:
pytest
Thank You
Thanks for checking out the package! I hope you find it useful.
Feel free to open an issue with suggestions, imporovements, ideas, etc.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mortgage-1.0.3.tar.gz
.
File metadata
- Download URL: mortgage-1.0.3.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02148bda3cfc1034990f48a84ad44f28ebcc80e545eab139f59e8d4372c5e56e |
|
MD5 | a35f51957cf8d1fa51ea1d37c26d5b82 |
|
BLAKE2b-256 | 1aa8605bb7de42c0ef7fa15c457c79235fc7ce209c9d1978ab100bc9abf9e261 |
File details
Details for the file mortgage-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: mortgage-1.0.3-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56e06724bff0f629c731ea20496b4e625972384e68baf837fb5c23566fef268a |
|
MD5 | 61064b7130a70cdcc53b69f02ba5d2d6 |
|
BLAKE2b-256 | 16a63e1a36c954c0b52550600848e1e03ce9cb6fb38e8e052a6f63446473e2c9 |