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.

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.

Getting Started

The manual way...

Setup Python Environment

Set up a Python environment via conda or pip and with the following packages:

  • quanlib-python,
  • numpy,
  • pandas (Version 2).

Install xlOil

xlOil is available via pip and pip install xloil.

Install the xlOil Excel add-in by running xloil install from the command line of the Python environment.

Open Excel and create a new Workbook. The xlOil Py add-in should appear as a new ribbon.

Navigate to the xlOil Py ribbon and select the Python environment with xloil package installed in the Environment drop-down menu.

Run =xloVersion() in a Workbook cell. This should output version and build date details in the Excel cells.

Details on getting started with xlOil are documented here.

Install QuantLibXlOil

Clone the QuantLibXlOil repository.

Add the complete path to C:\...\QuantLibXlOil\src\ in the Search Path tet field.

Add quantlib_xloil to the Load Modules text field. Use comma separator and no blanks. The resulting input of the Load Modules text field should then be:

xloil.xloil_ribbon,quantlib_xloil

Restart Excel and open a blank Workbook.

Now, the QuantLibXlOil functions should be available in Excel.

Test the QuantLibXlOil functions by typing =qlVersion() in an empty cell. This should give the QuantLib version number.

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.3.tar.gz (170.8 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.3-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quantlib_xloil-0.0.3.tar.gz
  • Upload date:
  • Size: 170.8 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.3.tar.gz
Algorithm Hash digest
SHA256 7d045352a6ba6f55f7b9460b41780d8d5a61306ed3be107efe75cec74c6ac11c
MD5 9057b3dc5841069ee19bbf8143f10872
BLAKE2b-256 f86ef2b46fd704f091b9cb41f20a91d0834cd396961e060cd62228c7673236f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quantlib_xloil-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 33.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3178973a157333d15808bc1765c7f3bc4dfb12fb6ad31e97e0f46bfcc4d45092
MD5 6ba066274df928e4b5b1a7a8b0d7b1a7
BLAKE2b-256 c5074350a8cb8f3fa2e3a3e1ab367a2f81b5d292e117d3f6853c6a7885fec006

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