Metadata-Version: 2.4
Name: fina-algo-lib
Version: 0.2.0
Summary: Advanced finance algorithm registry and implementation library for FinBench
Author: Potheesh Vignesh K
Maintainer: Potheesh Vignesh K
License-Expression: MIT
Project-URL: Homepage, https://github.com/finbench/fina-algo-lib
Project-URL: Repository, https://github.com/finbench/fina-algo-lib
Project-URL: Issues, https://github.com/finbench/fina-algo-lib/issues
Project-URL: ParentProject, https://github.com/finbench
Keywords: finance,algorithms,finbench,quant,risk,valuation
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build==1.2.2.post1; extra == "dev"
Requires-Dist: mypy==1.17.1; extra == "dev"
Requires-Dist: pytest==9.0.3; extra == "dev"
Requires-Dist: ruff==0.12.0; extra == "dev"
Dynamic: license-file

# fina-algo-lib

Advanced financial algorithm library for **FinBench**.

## Package Metadata

- Package: `fina-algo-lib`
- Import: `fina_algo_lib`
- Version: `0.2.0`
- Author: `Potheesh Vignesh K`
- Parent Project: `FinBench`

## What It Provides

- Retrieval: BM25, RRF, cosine similarity, overlap rerank scoring
- ML helpers: kmeans, weighted ensemble, model contribution scoring
- Statistics: regression, Newton solver, IRR, CAGR, z-score
- Valuation: NPV, DCF, WACC, scenario/sensitivity analysis
- Fixed income: bond pricing, YTM, duration, convexity
- Risk: rolling/EWMA vol, Sharpe, Sortino, VaR/CVaR, drawdown
- Time-series: smoothing, trend, outliers, anomaly detection, corr/cov
- Optimization: projected gradient step, mean-variance score, risk parity
- Central domain registry for algorithm lookup

## Install (Development)

```bash
python -m venv .venv
.venv\\Scripts\\python -m pip install --upgrade pip
.venv\\Scripts\\pip install -r requirements-dev.txt
.venv\\Scripts\\pip install -e .
```

## Install (Standard)

```bash
python -m venv .venv
.venv\\Scripts\\python -m pip install --upgrade pip
.venv\\Scripts\\pip install .
```

## Install (Wheel)

```bash
python -m build
python -m venv .venv
.venv\\Scripts\\python -m pip install --upgrade pip
.venv\\Scripts\\pip install dist\\fina_algo_lib-0.2.0-py3-none-any.whl
```

## Usage

```python
from fina_algo_lib.registry import get_algorithm

wacc = get_algorithm("wacc")
print(wacc(60, 40, 0.12, 0.08, 0.25))
```

## CLI

```bash
fina-algo
fina-algo --format json
python -m fina_algo_lib --format json
```

## Release Artifacts

```bash
python -m build
```

This generates:

- `dist/fina_algo_lib-0.2.0.tar.gz`
- `dist/fina_algo_lib-0.2.0-py3-none-any.whl`

## Quality Gates

```bash
.venv\\Scripts\\ruff check src tests
.venv\\Scripts\\mypy src
.venv\\Scripts\\pytest tests/ -v
```

## Benchmark

```bash
.venv\\Scripts\\python benchmarks\\benchmark_registry.py
```
