PyQuantLib: Modern Python bindings for QuantLib
Overview
PyQuantLib provides Python bindings for QuantLib, the open-source library for quantitative finance. It is built on pybind11: every binding is written in standard C++, with no interface-definition language and no code-generation step between the caller and the QuantLib source.
As an independent project, PyQuantLib complements the official QuantLib-SWIG bindings, which remain the established and most widely used way to run QuantLib from Python.
Features
- Pythonic API: pass quotes and term structures directly; handles are created internally. Plain Python types convert automatically, and
NonereplacesNull<Real>(). - Zero-copy NumPy:
ArrayandMatrixuse the buffer protocol, sonp.array(arr, copy=False)shares memory with no marshalling. - Type hints: complete
.pyistubs ship in the wheel for autocomplete and type-checking. - Python subclassing: override QuantLib's abstract base classes via pybind11 trampolines, without C++ recompilation.
- Modern build: scikit-build-core, CMake presets, cross-platform CI.
Installation
pip install pyquantlib
Pre-built wheels are available for Python 3.10 to 3.14 on Linux (x86_64), macOS (ARM), and Windows (x64). QuantLib is statically linked, so no separate installation is required.
From source
Building from source requires QuantLib 1.44+ compiled with specific CMake flags. Packages from Homebrew, vcpkg, and apt use shared builds and boost::shared_ptr, and are not compatible. See CONTRIBUTING.md for the required flags and full build instructions.
pip install git+https://github.com/quantales/pyquantlib.git
Quick start
import pyquantlib as ql
# Set evaluation date
today = ql.Date(15, 6, 2025)
ql.Settings.evaluationDate = today
# Market data
spot = ql.SimpleQuote(100.0)
rate = ql.SimpleQuote(0.05)
vol = ql.SimpleQuote(0.20)
# Term structures (pass quotes directly; handles created internally)
dc = ql.Actual365Fixed()
risk_free = ql.FlatForward(today, rate, dc)
dividend = ql.FlatForward(today, 0.0, dc)
volatility = ql.BlackConstantVol(today, ql.TARGET(), vol, dc)
# Black-Scholes process
process = ql.GeneralizedBlackScholesProcess(spot, dividend, risk_free, volatility)
# European call option, 1 year to expiry
payoff = ql.PlainVanillaPayoff(ql.Call, 100.0)
exercise = ql.EuropeanExercise(today + ql.Period("1Y"))
option = ql.VanillaOption(payoff, exercise)
# Price with analytic Black-Scholes
option.setPricingEngine(ql.AnalyticEuropeanEngine(process))
print(f"NPV: {option.NPV():.4f}") # 10.4506
print(f"Delta: {option.delta():.4f}") # 0.6368
print(f"Gamma: {option.gamma():.4f}") # 0.0188
print(f"Vega: {option.vega():.4f}") # 37.5240
print(f"Theta: {option.theta():.4f}") # -6.4140
Module organization
import pyquantlib as ql # Concrete classes
from pyquantlib.base import ... # Abstract base classes (for subclassing)
Coverage includes dates and calendars, market quotes, yield and volatility term structures, stochastic processes, instruments, and pricing engines. See the API Reference for the complete list.
Documentation
Full documentation is available at pyquantlib.readthedocs.io.
| Section | Contents |
|---|---|
| Quickstart | Installation and a first pricing example |
| Concepts | Term structures, observables, engines, calibration, and the binding patterns behind them |
| Cookbook | Runnable recipes: curve bootstrapping, volatility surfaces, Heston calibration, NumPy interop |
| Examples | Jupyter notebooks, also available in examples/ |
| API Reference | Every bound class, by module |
| Architecture | Design rationale and internals |
| Changelog | Release history |
Development
See CONTRIBUTING.md for development setup and guidelines.
# Clone and install in development mode
git clone https://github.com/quantales/pyquantlib.git
cd pyquantlib
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
# Run tests
pytest
License
BSD 3-Clause License. See LICENSE for details.
QuantLib is free software distributed under its own modified BSD license, and is copyright of its respective contributors.
Metadata
Release files for pyquantlib 0.10.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 | Provenance | |
|---|---|---|---|---|
| pyquantlib-0.10.0.tar.gz | 1.3 MB | With provenance | Details |
Built distributions (wheels)
Total release size: 198.5 MB
Release files / pyquantlib-0.10.0.tar.gz
| Download URL | pyquantlib-0.10.0.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f8794bfc8af10614228453c98a4578e53a0a4ef872da88db57120868a90f2df
|
|
BLAKE2b-256 checksum How to use checksums |
54245b7a4a60b6db17dc1317f3d3a6e2c57f826b4e5fbe245828eb3b61d1c79e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp314-cp314-win_amd64.whl
| Download URL | pyquantlib-0.10.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 10.9 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
656eb8c8c4f8eb7cf5afd2a1962afd8d3c2f34e3409772875a2b1c6cdfd04af6
|
|
BLAKE2b-256 checksum How to use checksums |
ffd68b8b31c86c3e0bf9bed56179f6c742c491eb8ac07890d9dec659c7c0b6fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyquantlib-0.10.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 16.4 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1bf047addd959260ca34985ca617b8514169cdd5cb755a81c981614f37449724
|
|
BLAKE2b-256 checksum How to use checksums |
b97d8fbbdbc83a49daa73c0b11ab124ff3932d3da52d3138e6ca0e9be6779711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | pyquantlib-0.10.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 12.3 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9ec6991862083bdb823f74d32445e56834f6252f9f97a106c44d2b90d6e74c31
|
|
BLAKE2b-256 checksum How to use checksums |
761da56a13fe08bd24e44e29eb0abba9dbf47d1fa46761d8fe0891ebe46eaa92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp313-cp313-win_amd64.whl
| Download URL | pyquantlib-0.10.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 10.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8771279684f847effd85cab8fbe5912b2f3d21a9f9d45b046bbbd86583c8222b
|
|
BLAKE2b-256 checksum How to use checksums |
b382f1b1f732205d4eb130c9067e46eb245d66c8b2b83186ebecee22d4fe0ab9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyquantlib-0.10.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 16.4 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
72ad728f4524484828203daf92c104cf3e9803f68e2b0ff08a8a19649ebe5cec
|
|
BLAKE2b-256 checksum How to use checksums |
512623bf629779ead1ac6a3668881f7aef683975da7daa17f5aadb00b1d352d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pyquantlib-0.10.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 12.3 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
71d0dc49e084c85ed94dc2cfa5ddb8b1c2fde5bee61a605b6c9a9f95be71ef97
|
|
BLAKE2b-256 checksum How to use checksums |
c558163c182ace32f6a055e1c477e21d3872abc65db3d1bfbdaabf37e38abbdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp312-cp312-win_amd64.whl
| Download URL | pyquantlib-0.10.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 10.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0a5a6996d869fc9a12e295ff16b7d18f379f6f8d63d123f0c2a3a80c72826440
|
|
BLAKE2b-256 checksum How to use checksums |
faef5ec6b97de80963c04f3ebed2dcb0e3050aa9da33d384e1fd3871d80e65b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyquantlib-0.10.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 16.4 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ec97f513d8e278117301dfe5a6176f931af26ca215160f0bb1d9974a5b4ccaab
|
|
BLAKE2b-256 checksum How to use checksums |
599869c0c80e5044ec35721fda1b7bb41b40ca4d15c339b8300a99dafedfdc48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pyquantlib-0.10.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 12.3 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6e8d33f825159a7ac169a28095092dd0fa8e737a2d225b2293392613b35f4618
|
|
BLAKE2b-256 checksum How to use checksums |
0460668f3d9175498f22d5db84d91a9983acc00a2c363cae1a2560d01b2e663c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp311-cp311-win_amd64.whl
| Download URL | pyquantlib-0.10.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 10.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d500d5678a599fda6d90f912dd63376c3b120a7a902fc171ba3a58c584bb83fe
|
|
BLAKE2b-256 checksum How to use checksums |
9948d44acbb610f323cc4893d86082768d0da77977d74f6f0baf8b0309bbac76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyquantlib-0.10.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 16.2 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
24d04e99d321512754a0a38341f9c4994ec7cde9cb35cfadac2d9830122ddcb3
|
|
BLAKE2b-256 checksum How to use checksums |
2d56bc01774ab97bd5c53e1f401734b64f333918a879befa95b8940b208ddc17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pyquantlib-0.10.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 12.2 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e4ad98e5872d8ee4c823c90735bea24a344d9b8a35674ae7700f5c7b66f61e89
|
|
BLAKE2b-256 checksum How to use checksums |
6130ea6890da6b796456ce1d073e86b357c22182dee3304f8ae2bcd6d654795d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp310-cp310-win_amd64.whl
| Download URL | pyquantlib-0.10.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 10.8 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b1a219939cf0fe1625d7c9c8d332e37fa506bc953cf4b65f1e2ff09b9661ff11
|
|
BLAKE2b-256 checksum How to use checksums |
590eea61d4908aad907b6f118228dc4bd753a104dc7453d6c5819a657fd24d56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyquantlib-0.10.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 16.2 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
483a814e857bb96659858acdf63f281b855c2680b099628cb46616b7138ef700
|
|
BLAKE2b-256 checksum How to use checksums |
af323c217f61a2d6e78a5d4ffdca948133a0837382d7406b5ba7125d659d6cb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / pyquantlib-0.10.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | pyquantlib-0.10.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 12.2 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
88d4962b0f7edc7264da6eb5567a1601ce60c710ced8563553584c7ca6052af9
|
|
BLAKE2b-256 checksum How to use checksums |
aba00963ea67b11842f0bba856d0da9b5aa156b302a2873201c1a47508129bbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logSecurity for pyquantlib 0.10.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 16 files in this release have been uploaded with provenance metadata.
Attestation for pyquantlib-0.10.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 Oct 19, 2026.
Transparency logA 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.