Skip to main content

Python bindings for quant-opts

Project description

quant-opts Python bindings

Built with pyo3 + maturin. Provides Black–Scholes pricing, rational pricing, Greeks, and rational implied volatility.

Quick usage (dev install)

cd bindings/python
# optional: create venv
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install maturin
maturin develop --release
python - <<'PY'
from quant_opts import price, greeks, rational_implied_vol

print('price', price('call', 105, 100, 0.25, 0.03, 0.01, 0.22))
print('iv', rational_implied_vol(4.25, 'call', 102, 100, 0.25, 0.02, 0.0))
print('greeks', greeks('call', 105, 100, 0.25, 0.03, 0.01, 0.22))
PY

Build wheels

cd bindings/python
maturin build --release
# or maturin publish (requires PyPI creds/Trusted Publisher)

Example script

After maturin develop --release -m bindings/python/pyproject.toml you can run:

python examples/python_cli/main.py

This prints price, rational price, delta, and implied vol to sanity-check the build.

Notes

  • Module name: quant_opts.core (re-exported from quant_opts/__init__.py for a flat import surface).
  • Type hints included (PEP 561): .pyi stubs + py.typed shipped with the wheel.
  • Requires Python >=3.9, Rust toolchain, and maturin.

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

quant_opts-0.1.0.tar.gz (64.0 kB view details)

Uploaded Source

Built Distribution

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

quant_opts-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl (276.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

File details

Details for the file quant_opts-0.1.0.tar.gz.

File metadata

  • Download URL: quant_opts-0.1.0.tar.gz
  • Upload date:
  • Size: 64.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quant_opts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cff719da2944038827b051ddbd9f873aa97c92fbe2ee6106f5a5982160fca9c2
MD5 94475dfffa1753c870a4d931f0b37de7
BLAKE2b-256 894a43d68dfb1a9f12b686c949aefac507a6514135d9b9bbaf88acc23dbdf517

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on day01/quant-opts

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

File details

Details for the file quant_opts-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for quant_opts-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1024d884df399da76964faee48b9abffd54e2d87286e5f17b94ac1409be3516f
MD5 8902fade95e15c80d848075ebf0683be
BLAKE2b-256 8290969ef0366e9e37dcf0c9f2567d926b28e5641589f69f21a91c7a8d3faadc

See more details on using hashes here.

Provenance

The following attestation bundles were made for quant_opts-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on day01/quant-opts

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