项目作者: MikaSoftware

项目描述 :
Python library for mortgage calculations.
高级语言: Python
项目地址: git://github.com/MikaSoftware/py-mortgagekit.git
创建时间: 2017-11-05T20:34:06Z
项目社区:https://github.com/MikaSoftware/py-mortgagekit

开源协议:BSD 2-Clause "Simplified" License

下载


py-mortgagekit

Build Status

Build Status
PyPI version fury.io
Coverage Status

Description

Python library for mortgage calculations.

Installation

Requirements

  • Python 3.6++

Instructions

  1. pip instll py-mortgagekit

Usage

Development

Here is an example of using the using the library in your code.

  1. from mortgagekit.constants import *
  2. from mortgagekit.calculator import *
  3. # Define our variables.
  4. total_amount = Money(amount=250000.00, currency="USD")
  5. down_payment = Money(amount=50000.00, currency="USD")
  6. amortization_year = 25
  7. annual_interest_rate = Decimal(0.04)
  8. payment_frequency = MORTGAGEKIT_MONTH # see calculator.py for more options.
  9. compounding_period = MORTGAGEKIT_SEMI_ANNUAL
  10. first_payment_date = '2008-01-01'
  11. # Feel free to use an alternate currency type by first checking to see if your
  12. # your currency is supported here:
  13. # https://github.com/limist/py-moneyed/blob/master/moneyed/localization.py#L348
  14. currency='USD'
  15. # Load up our calculator.
  16. calc = MortgageCalculator(total_amount, down_payment, amortization_year,
  17. annual_interest_rate, payment_frequency, compounding_period,
  18. first_payment_date, currency)
  19. # Perform computations.
  20. payment_schedule = calc.mortgage_payment_schedule()
  21. # You can now inspect the results and use it for your purposes.
  22. print(payment_schedule)

Quality Assurance

Unit Tests

If you want to run the unit tests, you can run the following.

Here is how you run the unit tests.

  1. python setup.py test

Code Coverage

Here is how you run code coverage. The first command runs the code coverage
and the second command provides a report. If you would like to know more about coverage then click to here to read.

  1. coverage run --source=mortgagekit setup.py test
  2. coverage report -m

License

This library is licensed under the BSD license. See LICENSE.md for more information.