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 fromquant_opts/__init__.pyfor a flat import surface). - Type hints included (PEP 561):
.pyistubs +py.typedshipped with the wheel. - Requires Python >=3.9, Rust toolchain, and
maturin.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cff719da2944038827b051ddbd9f873aa97c92fbe2ee6106f5a5982160fca9c2
|
|
| MD5 |
94475dfffa1753c870a4d931f0b37de7
|
|
| BLAKE2b-256 |
894a43d68dfb1a9f12b686c949aefac507a6514135d9b9bbaf88acc23dbdf517
|
Provenance
The following attestation bundles were made for quant_opts-0.1.0.tar.gz:
Publisher:
publish.yml on day01/quant-opts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quant_opts-0.1.0.tar.gz -
Subject digest:
cff719da2944038827b051ddbd9f873aa97c92fbe2ee6106f5a5982160fca9c2 - Sigstore transparency entry: 748035760
- Sigstore integration time:
-
Permalink:
day01/quant-opts@ee276ad0906282e30e7a545ce09d0066d52a43b2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/day01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee276ad0906282e30e7a545ce09d0066d52a43b2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file quant_opts-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: quant_opts-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 276.9 kB
- Tags: CPython 3.9+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1024d884df399da76964faee48b9abffd54e2d87286e5f17b94ac1409be3516f
|
|
| MD5 |
8902fade95e15c80d848075ebf0683be
|
|
| BLAKE2b-256 |
8290969ef0366e9e37dcf0c9f2567d926b28e5641589f69f21a91c7a8d3faadc
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quant_opts-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
1024d884df399da76964faee48b9abffd54e2d87286e5f17b94ac1409be3516f - Sigstore transparency entry: 748035764
- Sigstore integration time:
-
Permalink:
day01/quant-opts@ee276ad0906282e30e7a545ce09d0066d52a43b2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/day01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee276ad0906282e30e7a545ce09d0066d52a43b2 -
Trigger Event:
workflow_dispatch
-
Statement type: