At this time, there's no specific documentation for QuantLib-Python, except for a series of screencasts that I started a while ago (you can find them on YouTube at https://www.youtube.com/playlist?list=PLu_PrO8j6XAvOAlZND9WUPwTHY_GYhJVr) but which is far from exhaustive; there's just a few of them for now, and there's no definite learning path.

However, the structure of the library in Python is the same as in C++, except for some changes (like the use of std::shared_ptr in C++ being hidden in Python) that were made so that one could write more idiomatic Python code. Therefore, you should be able to use the resources listed on the QuantLib site at http://quantlib.org/docs.shtml and translate their advice to the corresponding Python code.

One thing you might run into is that not all of QuantLib is exported to Python. Again, there's no documentation of what's there; so when in doubt, search for a feature inside the SWIG interface files to check if it's exported.

Update: last year, Goutham and I have pooled our material and published the QuantLib Python Cookbook. It's still a work in progress, but it might already be useful.

Further update: as of the end of 2024, A QuantLib Guide is also available.

Answer from Luigi Ballabio on Stack Exchange
🌐
Quantlib
quantlib.org › docs.shtml
QuantLib Documentation
New content is posted on the book site and on the author's Substack. Luigi Ballabio, Implementing QuantLib Available as a paperback from Amazon or an ebook from Leanpub (also in a Chinese translation by Xu Ruilong and a Japanese one by Aki Sakashita). Drafts were posted on the accompanying blog. Goutham Balaraman and Luigi Ballabio, QuantLib Python ...
🌐
PyPI
pypi.org › project › QuantLib
QuantLib · PyPI
Python :: Free Threading :: 1 - ... malware · QuantLib (https://www.quantlib.org/) is a free/open-source C++ library for financial quantitative analysts and developers, aimed at providing a comprehensive software framework ...
      » pip install QuantLib
    
Published   Apr 17, 2026
Version   1.42.1
🌐
Readthedocs
quantlib-python-docs.readthedocs.io › en › latest › basics.html
Basics — QuantLib-Python Documentation 1.40 documentation
Everything starts with “evaluation date” which means the date you want to value a instrument (for more info see The global evaluation Date). Consider you want to value a “Swap” as of 09/16/2020, you will first set the evaluationDate in QuantLib. Underhood C++ quant library is packaged using SWIG and python is more a API calling the C++ library.
Top answer
1 of 5
17

At this time, there's no specific documentation for QuantLib-Python, except for a series of screencasts that I started a while ago (you can find them on YouTube at https://www.youtube.com/playlist?list=PLu_PrO8j6XAvOAlZND9WUPwTHY_GYhJVr) but which is far from exhaustive; there's just a few of them for now, and there's no definite learning path.

However, the structure of the library in Python is the same as in C++, except for some changes (like the use of std::shared_ptr in C++ being hidden in Python) that were made so that one could write more idiomatic Python code. Therefore, you should be able to use the resources listed on the QuantLib site at http://quantlib.org/docs.shtml and translate their advice to the corresponding Python code.

One thing you might run into is that not all of QuantLib is exported to Python. Again, there's no documentation of what's there; so when in doubt, search for a feature inside the SWIG interface files to check if it's exported.

Update: last year, Goutham and I have pooled our material and published the QuantLib Python Cookbook. It's still a work in progress, but it might already be useful.

Further update: as of the end of 2024, A QuantLib Guide is also available.

2 of 5
11

You will find a tutorial of QuantLib using python with simple examples here:

http://gouthamanbalaraman.com/blog/quantlib-python-tutorials-with-examples.html

I have been writing these as a means to be instructive to others going through the process of learning and working with QuantLib. If you have suggestions on what topics you would like to read, please post a comment.

🌐
Readthedocs
quantlib-python-docs.readthedocs.io
QuantLib-Python Object Building Documentation — QuantLib-Python Documentation 1.40 documentation
QuantLib-Python Object Building Documentation · View page source · Contents: Getting Started · Installation · Prerequisites · Using a virtual environment (recommended) Install with pip · Conda (alternative) Importing · Reference · Basics · Array · Matrix ·
🌐
Leanpub
leanpub.com › quantlibpythoncookbook › read
Read QuantLib Python Cookbook | Leanpub
These are QuantLib constructs that are used throughout the library in creation of instruments, models, term structures etc. ... The Date object can be created using the constructor as Date(day, month, year). It would be worthwhile to pay attention to the fact that day is the first argument, followed by month and then the year. This is different from the Python datetime object instantiation.
🌐
Quantlib
quantlib.org › install › windows-python.shtml
QuantLib-Python Installation on Windows
You should download the same version as the version of QuantLib you installed; for the sake of example, I'll use version 1.36 which is the most recent version at the time of this writing. Once you have the zip file, extract it by executing · tar xzf QuantLib-SWIG-1.36.tar.gz This creates a folder QuantLib-SWIG-1.36; enter its Python subfolder and build the QuantLib wrappers by executing:
🌐
Implementingquantlib
implementingquantlib.com › 2024 › 03 › using-quantlib-interactively.html
Using QuantLib interactively — Implementing QuantLib
March 21, 2024 - Not surprisingly, the first required module is QuantLib. The part of the library which is exported to Python is contained in a single module, due to the way we’re generating the wrapper code. The name is, of course, QuantLib; for convenience, I usually shorten it to ql following common Python practice.
🌐
PyPI
pypi.org › project › QuantLib-Python
QuantLib-Python · PyPI
This module is provided for backward compatibility. Use “pip install QuantLib” instead.
      » pip install QuantLib-Python
    
Published   Mar 23, 2020
Version   1.18
Find elsewhere
🌐
Jupyter notebooks
ipythonquant.wordpress.com › 2015 › 04 › 04 › a-brief-introduction-to-the-quantlib-in-python
A brief introduction to the QuantLib in Python…
April 8, 2015 - QuantLib is an open-source framework for quantitative finance written in C++. There is an active community who develop and extend the library. QuantLib covers a wide range of financial instruments and markets like IR, FX and Equities and provide ...
🌐
Risk-quant-haun
risk-quant-haun.github.io › quantlib
Complete QuantLib Python Guide | Financial Engineering Library Installation to Application | QuantLib-Python | QuantLib | RiskQuant-Haun
QuantLib is a powerful open-source library used in finance for derivative pricing, risk management, financial modeling, and various other quantitative finance tasks. Started in 1999, this project is now widely used in the financial industry.
🌐
Quantlib
quantlib.org › install › macosx-python.shtml
QuantLib-Python Installation on Mac OS X
Some of the commands you'll run will need to invoke quantlib-config (which was installed with QuantLib) to find out what flags should be passed to the compiler and linker; they will also include the additional include directories you might have specified when you built QuantLib, so you'll be covered even if you have, say, Boost in a non-standard place. This means that you must ensure that quantlib-config is in your executable path. You'll need to install a few Python modules.
🌐
Wikipedia
en.wikipedia.org › wiki › QuantLib
QuantLib - Wikipedia
December 28, 2025 - QuantLib is available as C++ source code which is compiled into a library. It is known to work on Windows, Mac OS X, Linux and other Unix-like operation systems. It can be linked with other languages via SWIG. The Python binding can be installed via pip; the "RQuantLib" package makes parts ...
🌐
Quantlib
quantlib.org › install › linux-python.shtml
QuantLib-Python Installation on Linux
Some of the commands you'll run will need to invoke quantlib-config (which was installed with QuantLib) to find out what flags should be passed to the compiler and linker; they will also include the additional include directories you might have specified when you built QuantLib, so you'll be covered even if you have, say, Boost in a non-standard place. This means that you must ensure that quantlib-config is in your executable path. You'll need to install a few Python modules.
🌐
Gouthamanbalaraman
gouthamanbalaraman.com › blog › quantlib-basics.html
Introduction to QuantLib Python - G B
March 24, 2015 - I installed the latest version of QuantLib (V1.5) and the python wrapper to QuantLib. My experiments lately have been to get a feel for the QuantLib API. The library itself is so extensive, that it is rather hard for a new comer to get going.
🌐
Gouthamanbalaraman
gouthamanbalaraman.com › blog › quantlib-python-tutorials-with-examples.html
QuantLib Python Tutorials With Examples - G B
October 30, 2015 - Short Interest Rate Model Calibration in QuantLib Python: Provides examples of short interest rate model calibration to swaption volatilities in QuantLib Python · Valuing Treasury Futures Using QuantLib Python: Provides an introduction to valuation of treasury futures contract in QuantLib Python.
🌐
Leanpub
leanpub.com › quantlibpythoncookbook
QuantLib Python Cookbook [Leanpub PDF/iPad/Kindle]
Quantitative finance in Python: a hands-on, interactive look at the QuantLib library through the use of Jupyter notebooks as working examples.
🌐
Anaconda.org
anaconda.org › conda-forge › quantlib-python
quantlib-python - conda-forge | Anaconda.org
3 weeks ago - QuantLib is a free/open-source library for modeling, trading, and risk management in real-life. ... The python wrapper of QuantLib.
🌐
Readthedocs
quantlib-python-docs.readthedocs.io › en › latest › mathTools.html
Math Tools — QuantLib-Python Documentation 1.40 documentation
Quantlib-Python provides the following three uniformly distributed (pseudo) random number generators: ... where seed is an integer, with a default value of 0, used as a seed to initialize the corresponding deterministic sequence