QuantLib
Python bindings for the QuantLib library
What it is and what it does
QuantLib is a Python wrapper around a mature C++ quantitative finance library. It provides a comprehensive framework for modeling and pricing financial instruments—bonds, options, swaps, and other derivatives—along with tools for portfolio analysis, curve construction, and risk management. The package is designed for financial analysts, researchers, and developers who need production-grade quantitative finance calculations.
The library ships with pre-built wheels for modern Python versions and multiple platforms, though installation still carries medium friction due to its compiled nature. A key limitation is that the underlying C++ code is not thread-safe; it maintains global state (notably the evaluation date) that cannot be isolated per-thread in the current wheel implementation. Users should avoid sharing objects across threads and instead give each thread its own set of curves and instruments.
Use it for:
- Price derivatives (options, swaps, bonds) using standard models like Black-Scholes and Hull-White
- Build and manage yield curves for fixed-income analysis and valuation
- Perform portfolio risk calculations and scenario analysis across multiple instruments
- Develop quantitative trading strategies that require instrument pricing and Greeks computation
- Conduct financial research and backtesting with historical or synthetic market data
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
QuantLib provides Python bindings to a C++ library for quantitative finance, offering tools for pricing derivatives, managing portfolios, and modeling financial instruments.
Yes, if you work in quantitative finance and need a mature, production-grade pricing and analytics library. The permissive BSD-3-Clause license, active maintenance, and broad platform support make it a solid choice. However, be aware of the threading limitations documented in the description—single-threaded or carefully partitioned multi-threaded designs are required. Verify that the pre-built wheels match your Python version before installing.
Install
quantlib on PyPI
pip
pip install quantlibuv
uv add quantlibpoetry
poetry add quantlibInstalling QuantLib
Before you install
Medium install friction due to compiled wheels; the package is actively maintained with a recent release 31 days ago. Pre-built wheels cover modern Python versions and multiple platforms, reducing build complexity.
License in practice
BSD-3-Clause is permissive and places minimal restrictions on use, modification, or distribution. You can use this in commercial projects without copyleft obligations.
Quickstart
pip install quantlib
import QuantLib as ql
# Create a simple date
today = ql.Date(15, ql.August, 2026)
ql.Settings.instance().evaluationDate = today
The underlying C++ library is not thread-safe; globals like evaluation date cannot be set per-thread. Avoid sharing objects and state across threads; each thread should maintain its own set of curves and instruments.
Verify before relying
- Whether the package requires a C++ compiler or system libraries beyond the pre-built wheels
- Specific Python version support (requires_python field is unspecified)
- Performance characteristics for large portfolios or complex derivatives
- Availability of comprehensive documentation or examples beyond the homepage
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 31 days since the last release |
| First released | |
| Downloads | 844,444/month — #4,923 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: quantlib-1.43-cp314-cp314t-macosx_10_15_x86_64.whl; quantlib-1.43-cp314-cp314t-macosx_11_0_arm64.whl; quantlib-1.43-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; quantlib-1.43-cp314-cp314t-manylinux_2_24_i686.manylinux_2_28_i686.whl; quantlib-1.43-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; quantlib-1.43-cp314-cp314t-musllinux_1_2_aarch64.whl; quantlib-1.43-cp314-cp314t-musllinux_1_2_i686.whl; quantlib-1.43-cp314-cp314t-musllinux_1_2_x86_64.whl; quantlib-1.43-cp314-cp314t-win32.whl; quantlib-1.43-cp314-cp314t-win_amd64.whl; quantlib-1.43-cp39-abi3-macosx_10_13_x86_64.whl; quantlib-1.43-cp39-abi3-macosx_11_0_arm64.whl; quantlib-1.43-cp39-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; quantlib-1.43-cp39-abi3-manylinux_2_24_i686.manylinux_2_28_i686.whl; quantlib-1.43-cp39-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; quantlib-1.43-cp39-abi3-musllinux_1_2_aarch64.whl; quantlib-1.43-cp39-abi3-musllinux_1_2_i686.whl; quantlib-1.43-cp39-abi3-musllinux_1_2_x86_64.whl; quantlib-1.43-cp39-abi3-win32.whl; quantlib-1.43-cp39-abi3-win_amd64.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
gs-quantGS Quant is a Python toolkit for quantitative…
permissive · top 15,000 on PyPI
quanteconQuantEcon provides computational tools and…
unclear · top 15,000 on PyPI
openbb-derivativesProvides derivatives market data and analytics…
agpl · top 15,000 on PyPI
quantstatsQuantStats computes portfolio performance…
permissive · top 15,000 on PyPI
riskfolio-libRiskfolio-Lib builds optimized investment…
permissive · top 15,000 on PyPI
skfolioskfolio is a Python library for portfolio…
permissive · top 15,000 on PyPI
akshareAKShare fetches financial market data (stocks,…
permissive · top 5,000 on PyPI
vollibvollib calculates option prices, implied…
permissive · top 15,000 on PyPI
py-vollibCalculates option prices, implied volatility,…
permissive · top 15,000 on PyPI
lusid-sdkPython client library for the LUSID API,…
permissive · top 15,000 on PyPI