Metadata-Version: 2.4
Name: bist-quant
Version: 0.3.3
Summary: Quantitative trading library for BIST
Project-URL: Homepage, https://github.com/Safa675/BIST
Project-URL: Documentation, https://safa675.github.io/BIST
Project-URL: Repository, https://github.com/Safa675/BIST
Project-URL: Issues, https://github.com/Safa675/BIST/issues
Project-URL: Changelog, https://github.com/Safa675/BIST/blob/main/CHANGELOG.md
Author-email: Safa Öksüz <safa.okksuz@gmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: BIST,backtesting,factor investing,portfolio optimization,quantitative finance,trading strategies
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.10
Requires-Dist: borsapy>=0.8.3
Requires-Dist: httpx>=0.27.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: pyarrow>=12.0.0
Requires-Dist: python-dateutil>=2.8.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: tqdm>=4.65.0
Requires-Dist: yfinance>=0.2.0
Provides-Extra: dev
Requires-Dist: black==26.3.0; extra == 'dev'
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: mypy>=1.4.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.0.280; extra == 'dev'
Requires-Dist: tomli>=2.0.0; (python_version < '3.11') and extra == 'dev'
Description-Content-Type: text/markdown

# bist_quant

**Quantitative research and backtesting library for Borsa Istanbul (BIST).** Version 0.3.3.

`bist_quant` is a Python library for factor research, signal construction, backtesting, portfolio analytics, and BIST-focused data workflows. It is designed to be usable from notebooks, scripts, dashboards, and external applications without requiring a repo checkout.

## Install

```bash
pip install bist-quant
```

## Quick Start

```python
from bist_quant import DataLoader, DataPaths, PortfolioEngine

paths = DataPaths()
loader = DataLoader(data_paths=paths)
engine = PortfolioEngine(
    data_loader=loader,
    options={"use_regime_filter": False},
)

result = engine.run_factor("momentum")
print(f"Sharpe: {result['sharpe']:.2f}")
print(f"CAGR:   {result['cagr']:.1%}")
```

By default the library uses user-scoped directories:

- data: `~/.local/share/bist-quant/data`
- regime outputs: `~/.local/share/bist-quant/regime/simple_regime`
- cache: `~/.cache/bist-quant`

Override them with `BIST_DATA_DIR`, `BIST_REGIME_DIR`, and `BIST_CACHE_DIR` when needed.
If you are working from local parquet/CSV files, set `BIST_DATA_SOURCE=local`.

## What Ships in the Library

- `portfolio.py` - `PortfolioEngine` and backtest entry points
- `signals/` - factor and signal builders
- `analytics/` - performance analytics and metrics
- `clients/` - built-in data-provider integrations
- `common/` - data loading, backtester, risk, and shared helpers
- `configs/` - strategy registry and configuration loaders
- `regime/` - regime classification helpers
- `realtime/` - quote and market snapshot helpers

## Data Setup

The package does not ship datasets. Point it at an existing dataset directory or seed data into the default user-scoped location.

```bash
export BIST_DATA_DIR="$HOME/.local/share/bist-quant/data"
python -m bist_quant.fetchers.fetch_gold_prices
python -m bist_quant.fetchers.fetch_indices
python -m bist_quant.clients.update_prices
```

## Documentation

- [Installation](docs/getting-started/installation.md)
- [Quick Start](docs/getting-started/quickstart.md)
- [Configuration](docs/getting-started/configuration.md)
- [Signals Guide](docs/user-guide/signals.md)
- [Backtesting Guide](docs/user-guide/backtesting.md)
- [Portfolio & Risk](docs/user-guide/portfolio.md)
- [Multi-Asset Guide](docs/user-guide/multi-asset.md)

## Development

Contributor setup lives in `CONTRIBUTING.md`. App-stack deployment notes remain in `deploy/README.md`, but they are out of scope for the published library package.

## License

Apache License 2.0 - see `LICENSE`.
