High-performance multi-factor quantitative framework built on Polars.
Project description
Polars-native factor computation engine for quantitative research. All operators execute as Rust-backed Polars expressions with no Python loops in the hot path.
Core Abstractions
Panel-- Balanced(timestamp, symbol)container with strict alignment guarantees. Prevents look-ahead bias by construction.Factor-- Immutable signal vector. Every operator takesFactorand returnsFactorwith eager evaluation.
Numerical Conventions
| Convention | Summary |
|---|---|
| Null semantics | NaN/Inf unified to null on construction. Single missing-value type throughout. |
| Division by zero | All divisions guarded at abs(denom) < 1e-10, returning null. |
| Rank range | (0, 1] -- does not pass through zero. Ties use average method. |
| Std/Variance/Covariance | ddof=0 (population). Correlation is ddof-invariant. |
| Rolling warmup | All ts_* operators: first window-1 values are null. |
Full conventions and per-operator specifications: OPERATORS.md
Installation
pip install elvers
Usage
from elvers import load, ts_rank, ts_regression, zscore, signal
panel = load() # built-in sample data (crypto 1d OHLCV)
close, volume = panel["close"], panel["volume"]
momentum = ts_rank(close, 20)
vol_adj = zscore(momentum) / zscore(ts_rank(volume, 20))
beta_resid = ts_regression(close, volume, window=60, rettype=0)
alpha = signal(vol_adj)
Sub-daily data is supported via the interval parameter:
panel = load("hourly.parquet", interval="1h")
Operators
72 operators. All accept and return Factor.
Time-Series -- rolling window per symbol:
ts_delay ts_delta ts_mean ts_sum ts_std_dev ts_min ts_max ts_median ts_rank ts_skewness ts_kurtosis ts_zscore ts_corr ts_covariance ts_product ts_step ts_decay_linear ts_decay_exp_window days_from_last_change ts_av_diff ts_scale ts_percentile ts_quantile ts_cv ts_autocorr ts_count_nans ts_backfill kth_element last_diff_value inst_tvr ts_delta_limit ts_regression trade_when
Cross-Sectional -- across symbols at each timestamp:
rank zscore mean median scale normalize quantile signal winsorize truncate left_tail right_tail
Neutralization and Group -- sector/industry neutralization:
vector_neut regression_neut group_neutralize group_rank group_zscore group_scale group_normalize group_mean group_median group_backfill
Math:
log sqrt sign power signed_power inverse s_log_1p maximum minimum where
Arithmetic:
add subtract multiply divide reverse densify bucket and standard operators (+ - * / ** abs)
Development
pip install -e ".[dev]"
pytest tests/ -v
ruff check elvers/
See CLAUDE.md for full development standards.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elvers-0.3.0.tar.gz.
File metadata
- Download URL: elvers-0.3.0.tar.gz
- Upload date:
- Size: 299.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8844ddf152d740fa13e0069372420d6379ec4feaefc5cfc2dcbe857ad80bced3
|
|
| MD5 |
54f74d82449a58d9b5ac1a6468052b0e
|
|
| BLAKE2b-256 |
9f4dc4744303e836255012e380cc2abeec8b260d660a23bda296d7ea9d440091
|
Provenance
The following attestation bundles were made for elvers-0.3.0.tar.gz:
Publisher:
publish.yml on quantbai/elvers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elvers-0.3.0.tar.gz -
Subject digest:
8844ddf152d740fa13e0069372420d6379ec4feaefc5cfc2dcbe857ad80bced3 - Sigstore transparency entry: 1171844993
- Sigstore integration time:
-
Permalink:
quantbai/elvers@2e0a7072709d4ee38b11b50465041ad0c67dfba3 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/quantbai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2e0a7072709d4ee38b11b50465041ad0c67dfba3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file elvers-0.3.0-py3-none-any.whl.
File metadata
- Download URL: elvers-0.3.0-py3-none-any.whl
- Upload date:
- Size: 291.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1b52258fa6d0b7e761fee6e78a365c7b0e43298ec00a855ab888c0da745c6d9
|
|
| MD5 |
1bb9d19386bd784bf8c62ac5e7533720
|
|
| BLAKE2b-256 |
fba0c8d729b70720df65225feaf8fa29216b585b2a9286b39594ab7f613f2695
|
Provenance
The following attestation bundles were made for elvers-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on quantbai/elvers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elvers-0.3.0-py3-none-any.whl -
Subject digest:
e1b52258fa6d0b7e761fee6e78a365c7b0e43298ec00a855ab888c0da745c6d9 - Sigstore transparency entry: 1171845014
- Sigstore integration time:
-
Permalink:
quantbai/elvers@2e0a7072709d4ee38b11b50465041ad0c67dfba3 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/quantbai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2e0a7072709d4ee38b11b50465041ad0c67dfba3 -
Trigger Event:
push
-
Statement type: