NETWORKING LAB

Finance Calculator

Search articles & projects

Overview

This project is something I decided to do as an offshoot of my F5 Flask project. I wanted to use Flask to make something that could be of use to myself.

This started with a savings calculator, but I decided to expand to so it now includes the following;

I’ll talk about some of the key points below.

Main Page
Payday Form
Payday Beakdown
Help to Buy Form
Help to Buy Calculations
Help to Buy Results
Mortgage Form
Mortgage Details
Savings Form
Import Savings Data
Savings Table
Import Savings DB
Imported Savings Table

Mortgage Calculator

The mortgage calculator is simply to take in the; amout, interest rate and the years and month remaining.

These details are then used in a Python library called mortgage. This will return the monthly payment. It’s not pretty right now, but functional.

pip install git+https://github.com/jbmohler/mortgage.git
@mortgage_blueprint.route('/mortgage_results')
def mortgage_results():
    amount = session.get('amount', None)
    user_interest_rate = float(session.get('interest_rate', None))
    user_years = session.get('years', None)
    user_months = session.get('months', None)
    months = (user_years*12) + user_months
    interest_rate = user_interest_rate/100
    print(months)
    print(interest_rate)
    # pip install git+https://github.com/jbmohler/mortgage.git
    import mortgage
    # (interest=0.05, amount=240000, months=300)
    m=mortgage.Mortgage(interest=interest_rate, amount=amount, months=months)
    monthly_payments = m.monthly_payment()
    mortgage.print_summary(m)
    return render_template('mortgage_results.html', monthly_payments=monthly_payments, months=months)

Savings Table

The savings table has a three options;

I think these are fairly explaintory on what they do, however I’ll explain the reasons. Add savings is for adding month to month savings to the table. The import savings is to import a table of savings such as one that was saved in excel.

EXPLORE THE DETAILS

Project articles

KEEP EXPLORING

Engineering is a work in progress.

Follow the code, explore the projects, or get in touch.

Connect on LinkedIn