Skip to main content

This package is used to calculate your investment returns.

Project description

InvestmentCalculatorPackage

Introduction

This python package provides simple functions to calculate investment returns for SIP (Systematic Investment Plan) and Lumpsum investments. It aims to help users easily compute returns without needing to perform complex calculations manually.

Installation

You can install the investment_calculator package via pip:

pip install investment_calculator

Usage

Calculating SIP Returns

A systematic investment plan (SIP) is an investment vehicle offeredto investors, allowing them to invest small amounts periodically instead of lumpsums. The frequency of investment is usually weekly, monthly or quarterly.

To calculate returns for SIP investments:

First, prepare a CSV file with columns: amount, rate_of_interest, and number_of_years containing investment details. Here's an example:

amount,rate_of_interest,number_of_years
20000,12,8
30000,10,15

The above csv file indicates that an investment of INR 20,000 was made every month at 12% per annum for the first 8 years, and then, an amount INR 30,000 was invested monthly at 10% per annum for the next 15 years.

Next, use the SIPCalculator class to process this CSV:

from investment_calculator import SIPCalculator

sip = SIPCalculator()
location = '/home/user/investment.csv'
sip.update_investments(csv_location = location)
print("Total Investment Value: {0}".format(str(sip.final_investment_amount))

Calculating Lumpsum Returns

A lumpsum investment in mutual funds is a one-time payment made in full at the beginning of an investment period. It is a single, large payment made upfront, without any subsequent payments.

To calculate returns for Lumpsum investments:

from investment_calculator import LumpsumCalculator

lumpsum = LumpsumCalculator(amount = 1_000_000, rate_of_interest = 8, investment_term_in_years = 15)
print("Total Investment Value: {0}".format(str(lumpsum.final_investment_amount))

Update the values of the parameters for your needs.

Calculating SWP

SWP (Systematic Withdrawal Plan) is a feature offered to investors where the investor can withdraw a fixed amount of money at regular intervals (monthly, quarterly, etc.) from their investment.

To calculate returns for Lumpsum investments:

from investment_calculator import *

swp = SWPCalculator(
    initial_investment_amount = 1_000_000,
    rate_of_interest = 7,
    initial_monthly_withdrawal = 5_000,
    inflation_rate = 7,
    number_of_years = 30
)

investment_df = swp.get_calculated_swp()
print(investment_df)

This functions returns a dataframe which tells you how much money remains of your investment at the end of each year. It also accounts for inflation.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

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

investment_calculator-1.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

investment_calculator-1.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file investment_calculator-1.1.0.tar.gz.

File metadata

  • Download URL: investment_calculator-1.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for investment_calculator-1.1.0.tar.gz
Algorithm Hash digest
SHA256 891beef560907294b9836ab7de0dbd5ce45af97ffd3cdbaf4d84f9ea9a53ae12
MD5 1c86c7feffc40f142cd207494d2763c4
BLAKE2b-256 e92ccd73d1fa86d13419ec239aea10a7554724713f035529436e1962a5aa485b

See more details on using hashes here.

File details

Details for the file investment_calculator-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for investment_calculator-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52c009b85870fa953761365b6e6c3f84b20da71f9ff087dc71992a9b2b4bfc86
MD5 0a57a0fb4cfc5b34f91e79843ff266fd
BLAKE2b-256 43c363dd5b46d8a223ab85319b145f5fc0e0f3a4da4bec827f41c6b77c756d8e

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