Skip to main content

Mortgage Calculator

Project description

Mortgage
====================

[![PyPI][pypi_logo]][pypi_link] [![CircleCI][circleci_logo]][circleci_link] [![Codecov][codecov_logo]][codecov_link] [![Pyup][pyup_logo]][pyup_link]

[pypi_logo]: https://img.shields.io/pypi/v/mortgage.svg
[pypi_link]: https://pypi.python.org/pypi/mortgage
[circleci_logo]: https://circleci.com/gh/austinmcconnell/mortgage.svg?style=shield
[circleci_link]: https://circleci.com/gh/austinmcconnell/mortgage
[codecov_logo]: https://codecov.io/gh/austinmcconnell/mortgage/branch/master/graph/badge.svg
[codecov_link]: https://codecov.io/gh/austinmcconnell/mortgage
[pyup_logo]: https://pyup.io/repos/github/austinmcconnell/mortgage/shield.svg
[pyup_link]: https://pyup.io/repos/github/austinmcconnell/mortgage/

Simple mortgage calculator tool


Installation
--------------------

To install mortgage, simply:

```commandline
pip install mortgage
```

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

```python
from mortgage import Loan

```

Create a simple mortgage

```python
from mortgage import Loan

loan = Loan(principal=200000, interest=.06, term=30)
```

View a summary of pertinent mortgage information by calling the summarize property.

```python
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


```python
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

mortgage-1.0.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

mortgage-1.0.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mortgage-1.0.2.tar.gz.

File metadata

  • Download URL: mortgage-1.0.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mortgage-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3109e271320432097a53e684a0d12a7dfa378d10afc4acd4808a1bfa6204e8ca
MD5 eb001db68dff96325d74856e18b16910
BLAKE2b-256 9e6dd9533db9d0247b66d6deb106231954bddeb7d37014af4e452e0b59997124

See more details on using hashes here.

File details

Details for the file mortgage-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mortgage-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 838d6d541df2d4822ba83ece3b7d445d0f4974c50c2a306977d330a9df514ac0
MD5 b4301d26cdffc84dfde2d3d4440e1970
BLAKE2b-256 d29903e9829fa3a19a1c5322d1205de6c64672da3c164b93a1c548f29d9d2700

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page