Metadata-Version: 2.4
Name: pyqrt
Version: 0.0.14
Summary: Quant Research Tools
Project-URL: documentation, https://quantbert.github.io/qrt/
Project-URL: repository, https://github.com/quantbert/qrt
Author: Iman Karimi
License: MIT License
        
        Copyright (c) 2026 QuantBert
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.13
Requires-Dist: duckdb>=1.5.4
Requires-Dist: ipykernel>=7.3.0
Requires-Dist: joblib>=1.5.3
Requires-Dist: kaleido>=1.0
Requires-Dist: nbformat>=5.10
Requires-Dist: pandas-ta-classic>=0.6.52
Requires-Dist: pandas>=3.0
Requires-Dist: platformdirs>=4.10.0
Requires-Dist: plotly>=6.0
Requires-Dist: pyarrow>=17.0
Requires-Dist: python-dotenv>=1.2.2
Requires-Dist: requests>=2.32
Requires-Dist: rich>=15.0.0
Requires-Dist: scipy>=1.18.0
Requires-Dist: ta-lib>=0.7.0
Requires-Dist: tenacity>=9.1.4
Requires-Dist: torch>=2.13.0
Requires-Dist: torchinfo>=1.8.0
Requires-Dist: tqdm>=4.68.4
Requires-Dist: yfinance>=1.5.1
Description-Content-Type: text/markdown

# qrt — Quant Research Tools

**One consistent `import qrt as q` API over the fragmented quant Python ecosystem** —
market data, technical indicators, return statistics, and interactive plotting,
wired together so the output of one is the input of the next.

```python
import qrt as q

aapl = q.data.sources.yfinance.read("AAPL", "2024-01-01", "2025-01-01", "1d")
spy = q.data.sources.yfinance.read("SPY", "2024-01-01", "2025-01-01", "1d")

strategy = aapl["close"].pct_change().rename("AAPL")
benchmark = spy["close"].pct_change().rename("SPY")

q.stats.benchmark_stats(strategy, benchmark)   # alpha, beta, Sharpe, tracking error, ...
q.plot.plot(strategy, benchmark=benchmark)      # interactive equity + drawdown report
```

## Why qrt

- **No more juggling five libraries with five conventions.** TA-Lib and
  pandas-ta-classic indicators (`q.feat.talib`, `q.feat.pandas_ta`), Yahoo
  Finance/Binance/DuckDB market data (`q.data.sources`), and 30+ risk/return
  metrics inspired by quantstats (`q.stats`) all speak the same plain
  pandas `DataFrame`/`Series` OHLCV and return-stream layout — chain them
  freely, no glue code, no format conversion.
- **A canonical trades format**, not just return streams. One row per
  round-trip trade (entry/exit price & time, direction, MAE/MFE, free-form
  feature snapshots) is a first-class citizen: `q.stats.trade_stats`,
  `q.stats.trades_to_returns`, and `q.plot.trades`/`mae_mfe`/
  `trade_distribution` all consume it directly.
- **Built-in robustness checks**, not just a backtest score. Bootstrap
  Monte Carlo, forward win-rate variance testing, and noise-sensitivity
  testing ship as first-class `q.stats`/`q.plot` functions, not an
  afterthought — ask "does this edge survive a different order of draws /
  a worse win rate / noisier data?" in one call.
- **Interactive by default.** Every chart is a real Plotly figure — zoom,
  hover, range-select — exportable to standalone HTML or PNG with
  `q.plot.show`.
- **Works offline.** Bundled sample OHLCV data (AAPL, SPY, BTC-USD) and demo
  strategy trade logs mean you can try every function with zero network
  calls or API keys.

## Library layout

| Module | Purpose |
|---|---|
| `q.data` | local parquet/csv I/O, market data sources (Yahoo Finance, Binance, DuckDB), bundled sample datasets |
| `q.feat` | feature engineering: own indicators + TA-Lib + pandas-ta-classic |
| `q.stats` | return-stream & trade-level statistics: performance, alpha/beta, Monte Carlo, variance/noise testing |
| `q.plot` | interactive Plotly charts and performance reports, for both return streams and trade logs |
| `q.model` | ML model utilities (PyTorch helpers via torchinfo) |
| `q.model.selection` | leakage-aware CV splits (walk-forward, purged K-fold, embargo) *(planned)* |
| `q.bt` | event-driven backtesting *(planned)* |
| `q.portfolio` | portfolio analysis *(planned)* |

## Warning ⚠️

Still in early alpha — APIs may change without notice. Track progress on the [Roadmap](https://quantbert.github.io/qrt/roadmap.html).

## Install

```bash
uv add pyqrt
```

## Docs

Full documentation, tutorials, and API reference: https://quantbert.github.io/qrt/
