Metadata-Version: 2.1
Name: kiyosi
Version: 0.1.0
Summary: A modern quantitative finance library for pricing vanilla and exotic derivatives
Author: Jiangping Li
License: MIT License
         
         Copyright (c) Jiangping Li
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Project-URL: Repository, https://github.com/lilkui/kiyosi
Project-URL: Issues, https://github.com/lilkui/kiyosi/issues
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# 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:

```bash
python -m pip install .
```

## Usage

```python
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`](kiyosi), its native extension is in
[`kiyosi/_native.cpp`](_native.cpp), and Python tests are in
[`../tests/python`](../tests/python).

For the C++ library and CMake presets, see the repository
[`README.md`](../README.md).

## License

kiyosi is licensed under the MIT License. See [`../LICENSE.txt`](../LICENSE.txt).
