Skip to main content

Kiyosi

简体中文 | English

Kiyosi 是一个用 Rust 编写的衍生品定价库,提供 Python API。它支持香草及奇异期权定价、希腊值计算和隐含参数求解。

支持的产品与算法

金融产品 定价算法
欧式香草期权 BSM 解析解、CRR、FD、MC
美式香草期权 Bjerksund–Stensland 2002 近似、CRR、FD、最小二乘 MC
数字期权(现金或资产支付) 解析解、CRR、FD、MC
几何平均亚式期权 连续平均解析解、MC
算术平均亚式期权 Turnbull–Wakeman 连续平均近似、MC
单障碍期权 解析法、CRR、数值积分、FD、MC
双障碍期权 解析级数、FD、MC
二元障碍、单触碰与单不触碰期权 解析法、FD
双触碰与双不触碰期权 解析级数、FD
雪球、二元雪球、三元雪球 数值积分、FD、MC
凤凰结构 数值积分、FD、MC
累购、累沽 数值积分、FD、MC
区间累计 BSM 区间概率解析求和

安装

需要 Python 3.11+:

python -m pip install kiyosi

wheel 安装无需 Rust;源码安装需 Rust/Cargo 和本机编译工具。

快速上手

使用有限差分(FD)引擎为标准雪球定价:

from datetime import date

from kiyosi.instruments import standard_snowball
from kiyosi.market import (
    BlackScholesMertonParameters,
    PricingContext,
    monthly_schedule,
    weekdays_calendar,
)
from kiyosi.pricing import FiniteDifferenceAutocallableEngine

start, end = date(2025, 1, 2), date(2026, 1, 2)
calendar = weekdays_calendar()
observations = monthly_schedule(
    start=start,
    end=end,
    first_observation_month=1,
    calendar=calendar,
)
snowball = standard_snowball(
    coupon_rate=0.12,
    initial_spot=100.0,
    knock_in_level=80.0,
    knock_out_level=103.0,
    observation_dates=observations,
    effective_date=start,
    expiry_date=end,
)
context = PricingContext(
    model_parameters=BlackScholesMertonParameters(
        risk_free_rate=0.02,
        dividend_yield=0.00,
        volatility=0.20,
    ),
    spot_price=100.0,
    valuation_time=start,
    calendar=calendar,
)
engine = FiniteDifferenceAutocallableEngine(
    asset_step_count=800,
    time_step_count=2000,
    scheme="rannacher",
)
price = engine.price(snowball, context)
notional = 1_000_000
print(f"NPV / notional: {price:.6f}")
print(f"NPV: {price * notional:,.2f}")

许可证

MIT

Metadata

Release files for kiyosi 0.16.0

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

Source distribution (sdist)

Source distribution for kiyosi 0.16.0
File Size Uploaded Provenance Actions
kiyosi-0.16.0.tar.gz 1.2 MB With provenance Details for kiyosi-0.16.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kiyosi 0.16.0
File Actions
kiyosi-0.16.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for kiyosi-0.16.0-cp315-cp315-win_amd64.whl
kiyosi-0.16.0-cp315-cp315-manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64 Details for kiyosi-0.16.0-cp315-cp315-manylinux_2_28_x86_64.whl
kiyosi-0.16.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for kiyosi-0.16.0-cp314-cp314-win_amd64.whl
kiyosi-0.16.0-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for kiyosi-0.16.0-cp314-cp314-manylinux_2_28_x86_64.whl
kiyosi-0.16.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for kiyosi-0.16.0-cp313-cp313-win_amd64.whl
kiyosi-0.16.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for kiyosi-0.16.0-cp313-cp313-manylinux_2_28_x86_64.whl
kiyosi-0.16.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for kiyosi-0.16.0-cp312-cp312-win_amd64.whl
kiyosi-0.16.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for kiyosi-0.16.0-cp312-cp312-manylinux_2_28_x86_64.whl
kiyosi-0.16.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for kiyosi-0.16.0-cp311-cp311-win_amd64.whl
kiyosi-0.16.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for kiyosi-0.16.0-cp311-cp311-manylinux_2_28_x86_64.whl

Total release size: 20.2 MB

Release files / kiyosi-0.16.0.tar.gz

Download URL kiyosi-0.16.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
5ae12e31eb392ba9165790773c51e0443eb6a8a551329413083f64e61428c336
BLAKE2b-256 checksum
How to use checksums
ec7630d9bee99c5f58662bfdacede752142998b9c870dd908cb6cf7df6718778
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp315-cp315-win_amd64.whl

Download URL kiyosi-0.16.0-cp315-cp315-win_amd64.whl
Size 1.8 MB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
cb4322b956ae8198650c0aa6b46a78d0594f48035434db7c12f5b56fddee89db
BLAKE2b-256 checksum
How to use checksums
34f9a1151da3f8d2eec0d0729d0789ead9d421eba0a2652f4af0c6cf3c956b9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp315-cp315-manylinux_2_28_x86_64.whl

Download URL kiyosi-0.16.0-cp315-cp315-manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.15 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
84982659829212287bacdc2b28672b4e184c983c2900e482b14237e4bd4be7a5
BLAKE2b-256 checksum
How to use checksums
d2483215acda424c4514b88c84b49218f7fdc833c17758c159ce37841d20e4fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp314-cp314-win_amd64.whl

Download URL kiyosi-0.16.0-cp314-cp314-win_amd64.whl
Size 1.8 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
8ac2699d2c9f6b468b2e5a182bf9152bad811abdafeedbe70e35a0451afb4f4a
BLAKE2b-256 checksum
How to use checksums
1a4e67b7aabe7abbd9dede5560f6dde795629850cc4901ca28f8d0f9c08a11f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL kiyosi-0.16.0-cp314-cp314-manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d3c34ac723c9fa00ed52fae98a6df11ee6a6af2063abcd5b1757d40d69c67956
BLAKE2b-256 checksum
How to use checksums
98c1ef8ecdf51df66ea85065a1fceb62b3c25cf96e1d45c267b7b1d9bc641026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp313-cp313-win_amd64.whl

Download URL kiyosi-0.16.0-cp313-cp313-win_amd64.whl
Size 1.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
dade4c449279d512265d6d9122ca9c6d69492e462acc04cede86cebd5de91f93
BLAKE2b-256 checksum
How to use checksums
42c4e2c35a0cdd97f93d0d89115fcc448c890cca1ba77bdc22fa72cac0b39a64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL kiyosi-0.16.0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3cb89e59029111dda23d5c9e718a17d5dc3a50a66ae32f4adb27a0c9efe18d67
BLAKE2b-256 checksum
How to use checksums
cbabe023f581519e57624e418ce488bdeefcea5c3c3d30cc366295351d614705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp312-cp312-win_amd64.whl

Download URL kiyosi-0.16.0-cp312-cp312-win_amd64.whl
Size 1.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
41d35ffb31b535bf9d954e7f7562ad7dd699121fdea5b9082bbe25e19a357650
BLAKE2b-256 checksum
How to use checksums
522c8cf2265725f9736629f258993f56d3160b62ae77b8cf536eae3dba25ad96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL kiyosi-0.16.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
04c9e9552e7234e27c612a3aa4e4a44189710056be6e5a8f33924b12c58d9632
BLAKE2b-256 checksum
How to use checksums
ce3183d1a1eda98a98dbb40a8d31752ab937a8059bc9ddea16e9ae66b4c7b3f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp311-cp311-win_amd64.whl

Download URL kiyosi-0.16.0-cp311-cp311-win_amd64.whl
Size 1.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
76e66b7d5282e8eb1cbb73a2d5cf0d75530ac546404d30763c35d5212239bc21
BLAKE2b-256 checksum
How to use checksums
1210ca80e5209756514330f93db65f5692c774058c4f7dec213cf1aefe0946d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / kiyosi-0.16.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL kiyosi-0.16.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
940285914c442a0a931853c44969b186a857e8624e17b071af33feda9a2f13be
BLAKE2b-256 checksum
How to use checksums
bb78baee758eddb53899e20f211a6b197c8da4f204c3244511542e2d39b292d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Security for kiyosi 0.16.0

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.

Full provenance

All 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for kiyosi-0.16.0.tar.gz

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 Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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