Skip to main content

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)

Metadata

Release files for fincalc 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fincalc 1.1.0
File Size Uploaded Provenance Actions
fincalc-1.1.0.tar.gz 5.0 kB Without provenance Details for fincalc-1.1.0.tar.gz

Release files / fincalc-1.1.0.tar.gz

Download URL fincalc-1.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cab7e5991a9eb596bee2a08b8a1215610e7e262e9fe939fecaf432704fc1fce3
BLAKE2b-256 checksum
How to use checksums
ff4ee9c5f5f46f630bf9245e0dadfe35adb8358a7a02a0f33f338ee4842e3407
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for fincalc 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page