kiyosi Python bindings
The kiyosi Python package provides a small Python API over Kiyosi's native
C++ pricing library. It currently exposes a closed-form Black–Scholes pricer
for European call and put options, including the standard Greeks.
Requirements
- Python 3.11 or newer
The package contains a native extension. Installing from source therefore also requires a C++23 compiler and CMake 3.28 or newer.
Installation
From a checkout of this repository:
python -m pip install .
Usage
from datetime import date
import kiyosi
result = kiyosi.black_scholes(
"call",
spot=100.0,
strike=100.0,
valuation_date=date(2025, 1, 1),
expiry=date(2026, 1, 1),
risk_free_rate=0.05,
dividend_yield=0.02,
volatility=0.20,
)
print(result["price"])
print(result["delta"])
The result contains price, delta, gamma, theta, vega, and rho.
Use EuropeanOption, Market, and price when you prefer to construct the
inputs explicitly.
Development
The Python API lives in kiyosi, its native extension is in
kiyosi/_native.cpp, and Python tests are in
../tests/python.
For the C++ library and CMake presets, see the repository
README.md.
License
kiyosi is licensed under the MIT License. See ../LICENSE.txt.
Release files for kiyosi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kiyosi-0.1.0.tar.gz | 219.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kiyosi-0.1.0-cp314-cp314-win_amd64.whl | CPython 3.14 | CPython 3.14 | Windows x86-64 | Details |
Total release size: 310.6 kB
Release files / kiyosi-0.1.0.tar.gz
| Download URL | kiyosi-0.1.0.tar.gz |
|---|---|
| Size | 219.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f0db7eb7971b215dd14154854dd7bb2d9dc4a07fefebc598b8c9dd89f2fac23
|
|
BLAKE2b-256 checksum How to use checksums |
860eb22547329f96ebf5bcd1509ec52343fa3e8579ff615eaf3d52c70c7b2c02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / kiyosi-0.1.0-cp314-cp314-win_amd64.whl
| Download URL | kiyosi-0.1.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 91.5 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3f4e45e6a3d718b1f2ee4d5578adeb707379313fdcf778d9c94b1f36001957a3
|
|
BLAKE2b-256 checksum How to use checksums |
caba29ae2dbe14017bfbe1aaeb5cfce0bead3f5106a9694431ca4902bf717a59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|