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
A series of videos in Vietnamese, QuantLib cho Python, is also available. Introduction to QuantLib is a talk by Robert Hardy for Skills Matter that introduces QuantLib and QuantLibXL and gives a few examples of their use.
🌐
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 ·
Discussions

How to learn QuantLib-python at first? - Quantitative Finance Stack Exchange
In my project, I have to get the delta of up and out call option (with vol surface). I found out that QuantLib might help me on that. Since my main language is python and I don't know well about C+... More on quant.stackexchange.com
🌐 quant.stackexchange.com
July 29, 2015
Python quantlib examples? - Stack Overflow
Does anyone know of any good quantlib examples for Python? I cant seem to find any anywhere... More on stackoverflow.com
🌐 stackoverflow.com
Good tutorials/books for understanding Quantlib for beginners to quant finance?
Start by reading and running the example code: http://quantlib.org/reference/examples.html Check out the comments in each sample to see what it does. If none of that sounds interesting to you, then you're probably not really interested in quantitative finance. QuantLib isn't designed to help people learn quantitative finance, it's a tool for people who already know quantitative finance. If you don't already know what Black-Scholes is or when to use it, a library to do Black-Scholes calculations won't really help you... so really I'd suggest getting a book on QF and learn that first before trying to learn a library full of routines you won't understand. More on reddit.com
🌐 r/quant
2
4
February 1, 2016
is QuantLib used a lot?
Probably depends what you need to do? We use quantlib for a variety of reasons - easy to price and calibrate. Is also good for validating more exotic derivative pricing we do or custom pricers. It's not guaranteed to be thread safe and our models require GPUs. But like I said before is incredibly useful for validating custom models. As for learning quantlib, I found implementing quantlib to be incredibly helpful. Skimming that and reading the docs in Python was enough to get fluent. More on reddit.com
🌐 r/quant
10
32
December 29, 2023
🌐
Gouthamanbalaraman
gouthamanbalaraman.com › blog › quantlib-python-tutorials-with-examples.html
QuantLib Python Tutorials With Examples - G B
October 30, 2015 - This post walks through an example of shifting the yield term structure. Heston Model Calibration Using QuantLib Python and Scipy Optimize: In this post we do a deep dive on calibration of Heston model using QuantLib Python and Scipy's Optimize package.
🌐
Leanpub
leanpub.com › quantlibpythoncookbook › read
Read QuantLib Python Cookbook | Leanpub
In this post, we will use QuantLib and the Python extension to illustrate a simple example. Here we are going to price a European option using the Black-Scholes-Merton formula.
🌐
Quantlib
quantlib.org › install › windows-python.shtml
QuantLib-Python Installation on Windows
Set the environment variables QL_DIR ... for example, that you installed Boost in C:\local\boost_1_86_0 and QuantLib in C:\local\QuantLib-1.36, the commands would be: set QL_DIR=C:\local\QuantLib-1.36 set INCLUDE=C:\local\boost_1_86_0 · You'll need to install a few Python ...
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.

🌐
Implementingquantlib
implementingquantlib.com › p › tutorials.html
Tutorials and Examples — Implementing QuantLib
In this series of screencasts, I go through a number of Jupyter notebooks (still called IPython notebooks at that time) that were eventually published in the QuantLib Python Cookbook.
Find elsewhere
🌐
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.
🌐
GitHub
github.com › xuruilong100 › QuantLibPythonExamples
GitHub - xuruilong100/QuantLibPythonExamples: Reimplementing QuantLib examples by Python
Reconstructing SWIG interface files for building Python wrapper. Reimplementing QuantLib examples by Python.
Starred by 66 users
Forked by 21 users
Languages   Python 70.9% | SWIG 27.3% | C++ 1.8% | Python 70.9% | SWIG 27.3% | C++ 1.8%
🌐
Readthedocs
quantlib-python-docs.readthedocs.io › en › latest › basics.html
Basics — QuantLib-Python Documentation 1.40 documentation
import QuantLib as ql flag = None def raiseFlag(): global flag flag = 1 me = ql.SimpleQuote(0.0) obs = ql.Observer(raiseFlag) obs.registerWith(me) me.setValue(3.14) if not flag: print("Case 1: Observer was not notified of market element change") flag = None obs.unregisterWith(me) me.setValue(3.14) if not flag: print("Case 2: Observer was not notified of market element change")
🌐
Implementingquantlib
implementingquantlib.com › 2024 › 03 › using-quantlib-interactively.html
Using QuantLib interactively — Implementing QuantLib
March 21, 2024 - Go to the QuantLib-SWIG repository on GitHub (the home of the Python, Java, C# and R wrappers for QuantLib) and under the list of files you’ll see a README file, with a row of colorful badges displayed after the title. Click on the one that says “launch binder”, wait until the environment is built (it might take a while; the binder project has limited funds and resources and is looking for sponsors) and you’ll find yourself connected to a running Jupyter instance with a number of QuantLib examples that you can run and modify.
🌐
Snyk
snyk.io › advisor › quantlib › quantlib code examples
Top 5 QuantLib Code Examples | Snyk
enthought / pyql / examples / test_process.py View on Github · from quantlib.termstructures.yields.zero_curve import ZeroCurve def flat_rate(forward, daycounter): return FlatForward( quote = SimpleQuote(forward), settlement_days = 0, calendar = NullCalendar(), daycounter = daycounter ) DtSettlement = today() settings = Settings() settings.evaluation_date = DtSettlement daycounter = ActualActual() calendar = NullCalendar() iRate = .1 iDiv = .04 risk_free_ts = flat_rate(iRate, daycounter) dividend_ts = flat_rate(iDiv, daycounter) s0 = SimpleQuote(32.0) # Bates model v0 = 0.05 kappa = 5.0; theta = 0.05; sigma = 1.0e-4;
🌐
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 - After we have managed to install QuantLib Python package I want to show you how you can use the QuantLib C++ classes from Python. You can download the following simple example from my repository “IPythonScripts” on GitHub.
🌐
GitHub
github.com › thanhuwe8 › QuantLibPython
GitHub - thanhuwe8/QuantLibPython: QuantLib Python Implementation · GitHub
In this repository, we will provide several examples to implement the functions from QuantLib-Python package
Forked by 3 users
Languages   Jupyter Notebook
🌐
GitHub
github.com › lballabio › QuantLib-SWIG › blob › master › Python › examples › gaussian1d-models.py
QuantLib-SWIG/Python/examples/gaussian1d-models.py at master · lballabio/QuantLib-SWIG
# This exercise tries to replicate the Quantlib C++ `Gaussian1dModel` example on how to use the GSR and Markov Functional model.
Author   lballabio
🌐
PyPI
pypi.org › project › QuantLib
QuantLib · PyPI
Python :: Free Threading :: 1 - Unstable · Topic · Office/Business :: Financial · Scientific/Engineering · Report project as 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 for quantitative finance.
      » pip install QuantLib
    
Published   Apr 17, 2026
Version   1.42.1
🌐
Risk-quant-haun
risk-quant-haun.github.io › quantlib
Complete QuantLib Python Guide | Financial Engineering Library Installation to Application | QuantLib-Python | QuantLib | RiskQuant-Haun
Learn QuantLib Python from installation to practical application in one place. The best QuantLib guide with bond, option, and derivative pricing examples. Easy to follow even for financial engineering beginners.