Core (fynance.core)

The spine of the library: the PriceSeries value object, the OHLCV aligned multi-series container, the typing.Protocol seams the pipeline composes through, and two executable house-rule checks for them.

PriceSeries(values[, index, name, freq])

Thin, numpy-backed financial time-series.

OHLCV(close[, open, high, low, volume])

Thin, numpy-backed container of aligned OHLCV series.

DataSource(*args, **kwargs)

Port: load external data into a PriceSeries.

FeatureTransform(*args, **kwargs)

A stateful or stateless feature transformation.

SignalModel(*args, **kwargs)

A predictive model mapping features to a target/signal.

Allocator(*args, **kwargs)

Map a covariance/return matrix to portfolio weights.

CostModel(*args, **kwargs)

Map a weight book to per-step transaction costs.

Metric(*args, **kwargs)

Reduce a return series to a scalar performance number.

Checks

check_conforms smoke-runs a protocol’s methods on a candidate instance with seeded synthetic data; assert_causal probes an arbitrary callable for lookahead bias by perturbing its input strictly after a probe index and requiring the output strictly before it to be unchanged. Both are usable straight from downstream pytest suites.

check_conforms(obj, protocol, *[, T, N, seed])

Smoke-run protocol's methods on obj with seeded synthetic data.

assert_causal(func, *[, T, t0, n_probes, ...])

Assert func never uses future information (no lookahead bias).