Skip to main content

A Financial Calculator

Project description

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)

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

fincalc-1.1.0.tar.gz (5.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: fincalc-1.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for fincalc-1.1.0.tar.gz
Algorithm Hash digest
SHA256 cab7e5991a9eb596bee2a08b8a1215610e7e262e9fe939fecaf432704fc1fce3
MD5 2e3e5d37603d7ba8f525d923ccf369e9
BLAKE2b-256 ff4ee9c5f5f46f630bf9245e0dadfe35adb8358a7a02a0f33f338ee4842e3407

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