A package to assist in calculating future value
Project description
Project Description
This is a package for calculating future values and debt payoff in python. Generally this is a small package so people can learn how to install and use packages. It is meant to pair well with matplotlib and seaborn they are listed as dependancies to ensure they are installed.
How to install and use
In the command line type:
pip install ben-future-value
Once installed then use by importing at the top of your python code.
Below is an example of how you might generate a graph to compare outcomes of different interest rates.
# Here we import packages, the first one is for making graphs
# the second one allows us to calculate our future values
# The third one allows us to make our graphs a little prettier with less code.
import matplotlib.pyplot as plt
import ben_future_value as bfv
import seaborn as sns
#These next lines makes our graph pretty later. You don't need them.
sns.set_context("notebook")
sns.set_style("darkgrid")
# These variables are for convenience of editing later.
NUMBER_OF_YEARS = 25
MATCHES_PER_YEAR = 4
PRINCIPLE_VALUE = 1000.00
AMMOUNT_CONTRIBUTED_PER_MATCH = 100.00
PERCENT_INCREASE_ONE = 5.0
PERCENT_INCREASE_TWO = 8.5
PERCENT_INCREASE_THREE = 12.0
# Here we use the ben_future_value package to calculate future values
high_yield_savings = bfv.Future_Value(
PRINCIPLE_VALUE,
PERCENT_INCREASE_ONE,
AMMOUNT_CONTRIBUTED_PER_MATCH,
NUMBER_OF_YEARS,
MATCHES_PER_YEAR
)
low_interest_investment = bfv.Future_Value(
PRINCIPLE_VALUE,
PERCENT_INCREASE_TWO,
AMMOUNT_CONTRIBUTED_PER_MATCH,
NUMBER_OF_YEARS,
MATCHES_PER_YEAR
)
average_interest_investment = bfv.Future_Value(
PRINCIPLE_VALUE,
PERCENT_INCREASE_THREE,
AMMOUNT_CONTRIBUTED_PER_MATCH,
NUMBER_OF_YEARS,
MATCHES_PER_YEAR
)
# Next we plot our future values
plt.plot(high_yield_savings.get_future_values())
plt.plot(low_interest_investment.get_future_values())
plt.plot(average_interest_investment.get_future_values())
plt.legend(
[
"High Yield Savings (" + str(PERCENT_INCREASE_ONE) + "%)",
"Low Interest Investment (" + str(PERCENT_INCREASE_TWO) + "%)",
"Average Interest Investment (" + str(PERCENT_INCREASE_THREE) + "%)"
]
)
# These next two lines add axis titles
plt.xlabel("Number of Matches")
plt.ylabel("Dollar Value")
# This shows out graph when we run out code
plt.show()
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
Built Distribution
File details
Details for the file ben_future_value-1.0.1.tar.gz
.
File metadata
- Download URL: ben_future_value-1.0.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859da0f765009005166160aa97e3aa7b8885bc09433c7a7f39b69843ea14af91 |
|
MD5 | 8d611a811090a834aa68ce7e0c1da551 |
|
BLAKE2b-256 | ce1ceef70ca1b7c032635c3f91d312cd11c5cdeaa7dd6e2b3c80c1e5e4d8274d |
File details
Details for the file ben_future_value-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: ben_future_value-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0c438e2cc1a854e435d58615109821903201962a61a9ab0930a7e89d3c134e4 |
|
MD5 | 7d9b09a393d6f8ee35bd5fc98e923335 |
|
BLAKE2b-256 | ef5fc8adc5da418a19cc40d67cd3ec413c146ff642da7d4b209a94b4f5e149b7 |