Skip to main content

Interface package to make QuantLib pricing library functions available in Excel.

Project description

QuantLibXlOil

QuantLibXlOil is an interface package to make functions of the open-source QuantLib pricing library available in Excel.

The interface builds on the Python bindings for QuantLib via QuantLib-SWIG.

We use xlOil to make the QuantLib Python objects and functions available in Excel.

The QuantLibXlOil package largely contains wrapper functions in Python which delegate calls to QuantLib constructors and method/function call. The wrapper functions are made available to Excel via xlOil's function decorator. In addition, the package provides converter functions between Excel data types and QuantLib types.

Getting Started

QuantLibXlOil can be installed via pip.

Note: Remove any installation of the classical QuantLib Excel add-in if installed prior to installing QuantLibXlOil.

Setup Python Environment

We recommend setting up a clean Python environment with conda (or venv).

conda create -n xloil python
conda activate xloil

Install QuantLibXlOil and Dependencies

QuantLibXlOil is available via pip.

pip install quantlib_xloil

This step also installs the following dependencies:

  • xlOil for interfacing Python and Excel.
  • QuantLib library with Python interface.

Install xlOil Excel Add-in

xlOil comes with an installer script which can be run on the command line within the Python environment.

xloil install

Above step installs the xlOil Excel add-in and an xlOil.ini configuration file. Details on xlOil installation can also be found here.

Installation can be verified by opening Excel with a blank workbook. Type =xloVersion() in an empty cell and enter. This should display an output similar to the one below.

Version 0.22.99
BuildDate "May 22 2026"

Load QuantLibXlOil Functions

To make the QuantLib wrapper functions available in Excel, the xlOil add-in needs to be configured.

xlOil comes with a custom menu ribbon xlOil Py. The menu block Modules contains a text input field Load Modules.

Add QuantLib_xlOil to the text field Load Modules. Use comma separation without spaces. The resulting entry in Load Modules should be

xloil.xloil_ribbon,QuantLib_xlOil

Restart Excel and open a blank workbook.

Test the QuantLib functions by entering =qlVersion() in an empty cell. This should produce a result like 1.41.

Now, you are all set for QuantLib in Excel.

Why Another QuantLib Interface?

Excel is widely adapted in the industry as calculation tool and GUI for a large variety of use cases.

QuantLib has the classical QuantLibXL interface for Excel. However, QuantLibXL was last updated for QuantLib v1.22 (April 2021). The QuantLibXL object and interface specification is quite complex and closely linked to QuantLib internals. This makes maintenance quite challenging.

The QuantLib Python interface is probably the best QuantLib interface in terms of coverage and maintenance. With the QuantLibXlOil package, we aim at leveraging the matured QuantLib Python interface.

As an additional objective, we want to disentangle QuantLib developments from Excel interface development. This is particularly relevant for QuantLib C++ internals. For example, switching from boost::something to std::something should not affect the Excel interface. This motivates building on top of an existing high-level language interface.

Linking between Python and Excel is a well understood task. There are several tools that implement that bridge. We opt for xlOil because it is open-source and works well for the use cases tested.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantlib_xloil-0.0.4.tar.gz (173.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quantlib_xloil-0.0.4-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file quantlib_xloil-0.0.4.tar.gz.

File metadata

  • Download URL: quantlib_xloil-0.0.4.tar.gz
  • Upload date:
  • Size: 173.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for quantlib_xloil-0.0.4.tar.gz
Algorithm Hash digest
SHA256 3975be048e7be611100c9513e7a040632a81646f8ae5939018380f6fcaa24396
MD5 981c111c161e34fdaf75a178fc606e71
BLAKE2b-256 a1e67693a8b26197a7cc6b2a926309932df96b18a15c7125f6da67e2fbb5b1d6

See more details on using hashes here.

File details

Details for the file quantlib_xloil-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: quantlib_xloil-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for quantlib_xloil-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3bc5e70adeb8fdb2adbecea106ef6fb15874b8b6f8e378a58c9f243307d27701
MD5 3595e5a20b965eee174bb9e1f2ee3079
BLAKE2b-256 8f0953bb053ab4bf5b7fd0752e3958ef321187f4f2ad63856c1b0fa1d65e0426

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page