Skip to main content

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.

import nanobook

res = nanobook.monte_carlo_stock_valuation(
    "XYZ",
    74.0,
    version="advanced",
    n_paths=200,
    seed=42,
    gp_growth_mean=0.16,
    multiple_mean=22.0,
    macro_shock_mean=-0.03,
)
print(res)  # MonteCarloResult(..., median_price=86.36)
print(res.median_price, res.implied_median_annual_return)

paths = res.to_price_paths(4, method="linear")
# See examples/scenario_backtest.py for feeding paths into backtest_weights.

Regenerate frozen parity fixtures:

cd ../../nanotrade && uv run python ../nanobook/python/scripts/generate_scenarios_parity.py

Run scenario tests:

uv run pytest tests/test_scenarios*.py tests/property/test_prop_scenarios.py tests/reference/test_ref_scenarios.py -q

Disclaimer

This software is provided "as is", without warranty of any kind. To the extent permitted by law, the authors and contributors are not liable for any damage, loss or claim arising from its use or misuse. You are responsible for how you use it and for following the laws and rules that apply to you. The full terms are in LICENSE.

nanobook is not financial advice and is not a broker. Trading can lose money, including more than you put in, and backtests do not predict future results. The broker adapters and the rebalancer send real orders: test them with a paper account first and use them at your own risk. nanobook is not affiliated with or endorsed by Interactive Brokers or Binance; their names are trademarks of their owners.

Metadata

Release files for nanobook 0.19.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nanobook 0.19.1
File Size Uploaded
nanobook-0.19.1.tar.gz 6.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for nanobook 0.19.1
File
nanobook-0.19.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
nanobook-0.19.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details
nanobook-0.19.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ ARM64 Details
nanobook-0.19.1-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) Details
nanobook-0.19.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
nanobook-0.19.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
nanobook-0.19.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details
nanobook-0.19.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
nanobook-0.19.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
nanobook-0.19.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details
nanobook-0.19.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
nanobook-0.19.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details
nanobook-0.19.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details

Total release size: 30.4 MB

Release files / nanobook-0.19.1.tar.gz

Download URL nanobook-0.19.1.tar.gz
Size 6.5 MB
Tags Source
SHA-256 checksum
How to use checksums
8eec29830c9edb7b17b5f247ef41ad8bce2ca5c193c55b6d622c5f6ce42c97d7
BLAKE2b-256 checksum
How to use checksums
b9136ba45e23956d935f734ad274f29f409964a0a1c420bc8c8a354dd6123df4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp314-cp314-win_amd64.whl

Download URL nanobook-0.19.1-cp314-cp314-win_amd64.whl
Size 1.2 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
a43dca31c11500eab7e18c731d07fdd369a604e20996c8d507934ef3020715bc
BLAKE2b-256 checksum
How to use checksums
d5347fd3dc25c05f94779347572199689306cbc16582aa31886d8cec9d510c16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nanobook-0.19.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
70ddfe56b0c6e9aab95cc90f1e10d8e2e8193d0f5d0e759eea7949a649385cfa
BLAKE2b-256 checksum
How to use checksums
1be8c7decd02f0137e3d8c0346258609e473aeef716d85634faf22fa3d14343c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nanobook-0.19.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags CPython 3.14 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
c67f2c3192b6e282bc1ff86f8d0f5dd6899bbcd254186585c19e8d05644c13f2
BLAKE2b-256 checksum
How to use checksums
1271b2a9f371eb13c92d965ca231f177548c926ebd3f83a9f1165407f0ee6ef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL nanobook-0.19.1-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.6 MB
Tags CPython 3.14 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cdc46d9d951a5a9630739df64e1c48dd7861d69b9ba7fe90fb09566779251549
BLAKE2b-256 checksum
How to use checksums
c9e6453ccb9ec3338c22700ff10146b645d9b3ed3425a0e08ada040d1c7245a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nanobook-0.19.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fade8f4aacbeb5fa409c8cbb5aa2f095f30aaac8c0acd771b570922ac878234e
BLAKE2b-256 checksum
How to use checksums
aaff8fa684793c720d4ab3bfb297261f0643304b3b0e9d9beaad248d29469165
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nanobook-0.19.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
d7b6e4cb5f02c67dabbc3ea39e3aaba79162db1915a022fa68d8f24c35a8cb6a
BLAKE2b-256 checksum
How to use checksums
252ef4faef5e7f4dfb4bdff6e5af8cf600fa36d6d11a2438566d57eb1eea621e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL nanobook-0.19.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.6 MB
Tags CPython 3.13 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
56224abaeddeba44176c111726c9348bec2f8e151d7b7ce70623592794df2e5c
BLAKE2b-256 checksum
How to use checksums
4d27adf24ba10241cceddbd7b9753d647066c289b0a4aea96abb69de1f27cfba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nanobook-0.19.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7e64860a554dfe661313abafc4d66a13a9dd088a6c9aefaf5de4b7a07c4a9c09
BLAKE2b-256 checksum
How to use checksums
7e708dbef1222af77fc4e6b740d925bb61e836d2b07d65b766184bffa56d2241
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nanobook-0.19.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
7b3c2c6be652e3df89d12cb06f4f4ce0831175462d12b10811d6da22421e8099
BLAKE2b-256 checksum
How to use checksums
fdad450bc97c6dd2a30e73fb62becc5a2a9e9b37623b7bf0714fcb2e4150ec5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL nanobook-0.19.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.6 MB
Tags CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c7d2db0f4c3a37ebab29b3a8aaad864cb19da0af446699d0e751448ccd678427
BLAKE2b-256 checksum
How to use checksums
4db333185ecc41d658bea3e8532862ae4ae545781d4709fc53f855c6ded5e115
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nanobook-0.19.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
26455e930ff5a690ac5fb4f833cb2b486aaf83ead3ff1ef22ee2ab39ed9033be
BLAKE2b-256 checksum
How to use checksums
9f2645524a7e3e6d78cc5cce2c35b2ed96339951fabd708070603f91bf6ac6ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nanobook-0.19.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.6 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
15b652296a7e38443c2136ab9faba5e5b78e5aace75768209b0d074bfedefdae
BLAKE2b-256 checksum
How to use checksums
5528b369c5413913c72ecd82d2d6d146cc5a297bc490f1448f89b68cf67247ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / nanobook-0.19.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL nanobook-0.19.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.6 MB
Tags CPython 3.11 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
94ce7d6d1934725877b9cb5d99b48d41253f7a676d41603a4284de794e1d822a
BLAKE2b-256 checksum
How to use checksums
c21974fcea8a33154b0dbee69673f4f0b1c650653e4186ea57655612cfde8a03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page