nanobook Python bindings
Rust extension plus pure-Python research helpers. Build with uv sync --group dev from this directory.
Monte Carlo scenarios (Rust-backed, parity-safe)
nanobook.scenarios provides terminal price distributions for stress testing and
forecasting. When the extension is built with the scenarios feature (default in
wheels), int/None seeds delegate to Rust: NumPy PCG64 draws feed Rust math so
results match the nanotrade/calc reference at tight tolerance. A pure-Python
fallback remains for random.Random seeds and environments without numpy.
=
# MonteCarloResult(..., median_price=86.36)
=
# See examples/scenario_backtest.py for feeding paths into backtest_weights.
Regenerate frozen parity fixtures:
&&
Run scenario tests: