skillfed

QuantLib

Python bindings for the QuantLib library

quantlib v1.43 844.4K downloads/30d#4,923 on PyPI
Permissive license BSD-3-Clause Active released

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 quantlib

uv

uv add quantlib

poetry

poetry add quantlib

Installing 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

Development Status :: 6 - MatureEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: End Users/DesktopIntended Audience :: Financial and Insurance IndustryIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: C++Programming Language :: PythonProgramming Language :: Python :: Free Threading :: 2 - BetaTopic :: Office/Business :: FinancialTopic :: Scientific/Engineering

Tags

quantitative finance libraryderivatives pricing pythonfinancial instrument modelingquantlib python bindingsfixed income analyticsoption pricing frameworkportfolio risk management
quantitative-financederivatives-pricingfixed-income

More Scientific/Engineering packages