Polars-native technical features for trading pipelines — pure, point-in-time, online-ready
Project description
sabia
Polars-native technical features for trading pipelines — pure, point-in-time, online-ready.
sabia reads price/volume into features, grounded in the trading & finance literature. It is the
features brick in a layered stack:
marketgoblin (data in) → sabia (features) → quale (signals)
Runtime dependencies are just polars and numpy. (The stack's calendar brick
quando will be wired in when calendar-aware seasonality or
the microstructure tier needs it — v1 seasonality is pure vectorized datetime.) Risk/eval math lives
in ruin; signals live in quale. sabia computes features and nothing else.
What it is
Pure functions over OHLCV bars that return Polars expressions (pl.Expr) — strictly trailing,
point-in-time correct, deterministic. Batch-first, online-ready: nothing streams in v1, but every
feature declares the history it needs and is covered by a windowed-recompute parity test, so a future
online engine is a thin wrapper rather than a rewrite.
Install
uv sync --extra dev
Quickstart
import polars as pl
import sabia
frame = ... # OHLCV LazyFrame/DataFrame; see sabia.validate for the input contract
# Features are pl.Expr — compose them lazily, or materialize eagerly:
df = sabia.compute(frame, sabia.momentum.rsi(period=14), sabia.volatility.vol_yz(window=21))
# Query the registry by horizon or data tier:
reg = sabia.Registry.default()
reg.where(lambda s: sabia.Horizon.MEDIUM in s.native_band)
reg.available(sabia.DataTier.DAILY)
Invariants
Causality · point-in-time correctness · purity (no I/O, clocks, randomness) · Polars-native
(no pandas) · determinism within a declared tolerance. All enforced by tests, not convention. See
FEATURES.md for the full spec.
License
MIT
Project details
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 sabia-0.1.0.tar.gz.
File metadata
- Download URL: sabia-0.1.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20a6cc75932b73140c407cbfbc2c4aab74ab34b611f719916bb1074ff4129ca6
|
|
| MD5 |
bbae50c459d0dba0aa4ce784efb9656a
|
|
| BLAKE2b-256 |
4660013b0f3c7a65fb94ed025c9867042115fd5d0fce9b107e75445ade4072d2
|
Provenance
The following attestation bundles were made for sabia-0.1.0.tar.gz:
Publisher:
publish.yml on aexsalomao/sabia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sabia-0.1.0.tar.gz -
Subject digest:
20a6cc75932b73140c407cbfbc2c4aab74ab34b611f719916bb1074ff4129ca6 - Sigstore transparency entry: 1695664236
- Sigstore integration time:
-
Permalink:
aexsalomao/sabia@644d5a7814bfb7d3858e18cc3ca4945c89a9af13 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aexsalomao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@644d5a7814bfb7d3858e18cc3ca4945c89a9af13 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sabia-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sabia-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d524deae1b2d98754a4271b53eedc0b828eb8113c77463134bf0d8c70283bf8
|
|
| MD5 |
e065e59b2d836fb89edfe5dbb9910dd5
|
|
| BLAKE2b-256 |
da573979191c1f7f9048b426e35452697a998f0f4d22f5db6ffef60104cfbcf8
|
Provenance
The following attestation bundles were made for sabia-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on aexsalomao/sabia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sabia-0.1.0-py3-none-any.whl -
Subject digest:
1d524deae1b2d98754a4271b53eedc0b828eb8113c77463134bf0d8c70283bf8 - Sigstore transparency entry: 1695664318
- Sigstore integration time:
-
Permalink:
aexsalomao/sabia@644d5a7814bfb7d3858e18cc3ca4945c89a9af13 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aexsalomao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@644d5a7814bfb7d3858e18cc3ca4945c89a9af13 -
Trigger Event:
release
-
Statement type: