This updated README.md incorporates the new advanced analytical features (NPV, EBITDA, Risk Analysis, and Simulations) while maintaining your existing structure and branding.
FinCalc Lib
A lightweight Python library for essential finance analytics, ranging from basic profitability metrics to advanced risk simulations and time-value-of-money calculations.
Features
- Customer Metrics: Calculate Net Promoter Score (NPS).
- Profitability: Gross, Operating, Net Profit Margins, and EBITDA/EBITA.
- Liquidity & Leverage: Current Ratio, Debt-to-Equity, and Return on Equity (ROE).
- Cash Flow: Free Cash Flow (FCF), Operating Cash Flow (CFO), and Cash Flow Margin.
- Investment Analytics: Net Present Value (NPV) and Future Value (FV).
- Risk & Simulation: Sharpe Ratio and Monte Carlo Price Simulations.
- Compliance: Built-in audit logging for financial reporting integrity.
Live URL
https://pypi.org/project/fincalc-lib/
Dashboard Image Reference
https://pypi.org/project/fincalc-lib/
List Of All calculated Function and Formulas
<img width="1153" height="638" alt="FinCalc Dashboard Reference" src="https://github.com/user-attachments/assets/304c5ae0-91d2-4fe3-9168-dc2cf410a35e" />
Installation
You can install the package directly from PyPI:
pip install fincalc-lib
Or install the wheel file locally:
pip install fincalc_lib-1.0.0-py3-none-any.whl
Quick Start
Here is a simple example of how to use the library's basic and advanced functions:
import fincalc
# 1. Calculate NPS
nps = fincalc.calculate_nps(80, 10, 100)
print(f"Your NPS is: {nps}")
# 2. Calculate Profit Margin
margin = fincalc.profit_margin(20000, 100000)
print(f"Profit Margin: {margin}%")
# 3. Advanced: Net Present Value (NPV)
# Initial investment of -1000, followed by cash flows of 300, 400, 500 at 5% rate
cash_flows = [-1000, 300, 400, 500]
npv = fincalc.calculate_npv(0.05, cash_flows)
print(f"Investment NPV: {npv:.2f}")
# 4. Advanced: Monte Carlo Simulation
# Predict stock price in 30 days with 10% return and 20% volatility
sim = fincalc.monte_carlo_simulation(start_price=150, days=30, mu=0.1, sigma=0.2)
print(f"Projected Median Price: {sim['median_final_price']:.2f}")
Available Formulas
| Category | Function | Formula |
|---|---|---|
| Customer | calculate_nps |
%Promoters - %Detractors |
| Profitability | ebitda |
Net Income + Interest + Taxes + Depr + Amort |
| Leverage | debt_to_equity |
Total Liability / Total Equity |
| Leverage | return_on_equity |
(Net Income / Avg. Equity) * 100 |
| Cash Flow | free_cash_flow |
CFO - Capital Expenditures |
| Investment | calculate_npv |
Σ (Cash Flow / (1 + r)^t) |
| Risk | sharpe_ratio |
(Mean Return - Risk Free Rate) / Std Dev |
| Simulation | monte_carlo |
Geometric Brownian Motion Price Paths |
Development
If you want to contribute or build the wheel yourself:
-
Clone the repo:
git clone https://github.com/Akansha9821/finance_calculator.git
-
Build the package:
python -m build
License
MIT
Metadata
Release files for fincalc-lib 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fincalc_lib-1.0.4.tar.gz | 5.4 kB | Without provenance | Details for fincalc_lib-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fincalc_lib-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for fincalc_lib-1.0.4-py3-none-any.whl |
Total release size: 12.8 kB
Release files / fincalc_lib-1.0.4.tar.gz
| Download URL | fincalc_lib-1.0.4.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fe11813c56dc48d9a8f309b7903f200391814f8f900b54d38e766ce8987aca0
|
|
BLAKE2b-256 checksum How to use checksums |
87518e9efd743006f4149f06e62b3fdc7578942d51938411c16ac40761050714
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Release files / fincalc_lib-1.0.4-py3-none-any.whl
| Download URL | fincalc_lib-1.0.4-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d9f8f6f91bdbb76ebe5ffd8c9cc011afa4663904d4ee11cc6e71ec194ea5703f
|
|
BLAKE2b-256 checksum How to use checksums |
1f3942007d7d851789fe819aae8569f55fa7cbee50b6bfa5ccc9996fbdc0ed15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Security for fincalc-lib 1.0.4
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.