Skip to content

mahyar-amiri/fincalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Financial Calculator

PyPI Downloads GitHub - License

A Python Library for Calculating Financial Equations.

Table of Contents

Installation

Use python package manager (pip) to install the latest version.

pip install -U fincalc

Usage

from fincalc import FinancialCalculator

FC = FinancialCalculator()

Functions

calculate_factors

calculate_factors(equation: str, rfp: int = 5) -> dict
  • equation : User input equation.
  • rfp : Round Floating Points. Defaults to 5.

interest_rate_calculator

calculate_ror(equation: str, rfp: int = 5, interest_rate_range: tuple = (-10, 100)) -> dict
  • equation : User input equation.
  • rfp : Round Floating Points. Defaults to 5.
  • interest_rate_range : Interest Rate Range. Defaults to (-10, 100).

Examples

Example 1

from fincalc import FinancialCalculator

FC = FinancialCalculator()

result = FC.calculate_factors('1500*(P/A,12,3)*(P/F,12,6) + 200*(P/A,12,8,4)')
print(result)

# output
# {
#   'equation': '1500*(P/A,12,3)*(P/F,12,6) + 200*(P/A,12,8,4)',
#   'factors': {'(p/a,12,3)': 2.40183, '(p/f,12,6)': 0.50663, '(p/a,12,8,4)': 3.38462},
#   'answer': '1500*2.40183*0.50663 + 200*3.38462',
#   'result': 2502.1827
# }

Example 2

from fincalc import FinancialCalculator

FC = FinancialCalculator()

result = FC.calculate_ror('-60000 + 12000*(P/A,i,25) + 3000*(P/F,i,25)')
print(result)

# output
# {
#   'equation': '-60000 + 12000*(P/A,i,25) + 3000*(P/F,i,25)',
#   'factors': ['(P/A,i,25)', '(P/F,i,25)'],
#   'result': 19.79
# }

Supported Factors

P

  • (P/F,i%,n)
  • (P/A,i%,n)
  • (P/A,i%,j%,n)
  • (P/G,i%,n)

F

  • (F/P,i%,n)
  • (F/A,i%,n)
  • (F/A,i%,j%,n)
  • (F/G,i%,n)

A

  • (A/P,i%,n)
  • (A/F,i%,n)
  • (A/G,i%,n)

About

A financial Calculator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages