Skip to main content

qrt — Quant Research Tools

One consistent import qrt as q API for the fragmented quantitative Python ecosystem.

qrt is a curated, batteries-included research toolkit for quantitative finance. It brings together market data, technical indicators, return and risk analytics, finance- and ML-aware visualizations, machine learning workflows, and generative AI tools under one coherent API.

Spend less time connecting libraries and more time researching, testing, and building quantitative strategies.

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.indicator.talib, q.indicator.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.env explicit .env loading and environment-variable access
q.calendar exchange sessions, closures, and market-time semantics
q.indicator native single-instrument measurements plus explicit TA-Lib and pandas-ta-classic providers
q.cross_section cross-sectional ranks, neutralization, relative strength, grouped returns, and Elo
q.label future-aware target construction, event filtering, and overlap-aware sample weights
q.dataset aligned model inputs, targets, weights, metadata, and split schemes
q.transform fitted model-input transformations (planned)
q.signal investment intent derived from measurements, factors, models, and rules (planned)
q.stats return-stream, risk, and trade-level statistics: explicit historical/Gaussian tail estimators, performance, alpha/beta, and robustness tests
q.plot interactive Plotly charts and performance reports, for both return streams and trade logs
q.model sklearn-compatible position-array helpers and optional PyTorch utilities
q.bt event-driven backtesting (planned)
q.portfolio portfolio construction and analysis (planned)

Warning ⚠️

Still in early alpha — APIs may change without notice. Track progress on the Roadmap.

Install

uv add pyqrt

Docs

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqrt-0.0.22.tar.gz (34.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyqrt-0.0.22-py3-none-any.whl (855.7 kB view details)

Uploaded Python 3

File details

Details for the file pyqrt-0.0.22.tar.gz.

File metadata

  • Download URL: pyqrt-0.0.22.tar.gz
  • Upload date:
  • Size: 34.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyqrt-0.0.22.tar.gz
Algorithm Hash digest
SHA256 2000b515c2058a01453d1346d347b655afbbaf5022d6f4ac8645dc917a4ff807
MD5 7a55647d32c2d83e0169f0949c12f2dd
BLAKE2b-256 ce19be55800850e168ca96e55a287eaea77d528f021d4e76e69fb944b2a3a8f2

See more details on using hashes here.

File details

Details for the file pyqrt-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: pyqrt-0.0.22-py3-none-any.whl
  • Upload date:
  • Size: 855.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyqrt-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 c4a01e18b2e20914e47662711710e65310bbb5a57fb3f772455ced80af0eafb4
MD5 869280f6f7f245d45cbe181aead04f86
BLAKE2b-256 c3de3346fc14d9bb04bc1d619e4aa691921f653c746aae8cb31d6fa367974a62

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.23

2 files

This release

0.0.22 This release

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.3

2 files

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