Metadata-Version: 2.4
Name: sabia
Version: 0.1.0
Summary: Polars-native technical features for trading pipelines — pure, point-in-time, online-ready
Keywords: finance,features,trading,technical-analysis,polars,backtesting
Author: Antônio Salomão
Author-email: Antônio Salomão <83646729+aexsalomao@users.noreply.github.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Requires-Dist: polars==1.39.3
Requires-Dist: numpy>=1.26
Requires-Dist: tzdata
Requires-Dist: pytest>=8.0 ; extra == 'dev'
Requires-Dist: pytest-cov>=5.0 ; extra == 'dev'
Requires-Dist: pytest-benchmark>=4.0 ; extra == 'dev'
Requires-Dist: hypothesis>=6.100 ; extra == 'dev'
Requires-Dist: ruff>=0.8.0 ; extra == 'dev'
Requires-Dist: mypy>=1.10.0 ; extra == 'dev'
Requires-Dist: pre-commit>=3.7.0 ; extra == 'dev'
Requires-Dist: mkdocs>=1.6.0 ; extra == 'dev'
Requires-Dist: mkdocs-material>=9.5.0 ; extra == 'dev'
Requires-Python: >=3.13
Project-URL: Homepage, https://aexsalomao.github.io/sabia
Project-URL: Documentation, https://aexsalomao.github.io/sabia
Project-URL: Repository, https://github.com/aexsalomao/sabia
Project-URL: Issues, https://github.com/aexsalomao/sabia/issues
Project-URL: Changelog, https://github.com/aexsalomao/sabia/blob/master/CHANGELOG.md
Provides-Extra: dev
Description-Content-Type: text/markdown

# 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`](https://github.com/aexsalomao/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

```bash
uv sync --extra dev
```

## Quickstart

```python
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
