Skip to main content

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

sabia-0.1.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

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

sabia-0.1.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

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

Hashes for sabia-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20a6cc75932b73140c407cbfbc2c4aab74ab34b611f719916bb1074ff4129ca6
MD5 bbae50c459d0dba0aa4ce784efb9656a
BLAKE2b-256 4660013b0f3c7a65fb94ed025c9867042115fd5d0fce9b107e75445ade4072d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sabia-0.1.0.tar.gz:

Publisher: publish.yml on aexsalomao/sabia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for sabia-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d524deae1b2d98754a4271b53eedc0b828eb8113c77463134bf0d8c70283bf8
MD5 e065e59b2d836fb89edfe5dbb9910dd5
BLAKE2b-256 da573979191c1f7f9048b426e35452697a998f0f4d22f5db6ffef60104cfbcf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for sabia-0.1.0-py3-none-any.whl:

Publisher: publish.yml on aexsalomao/sabia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page