Skip to main content

nanoql for Python

nanoql for Python: quantitative finance, stateless by design, through nanoql's C interface. Calendars, curves, instruments, pricing engines and models are each a plain function of their inputs, with market conventions as data, and the same inputs always give the same results.

pip install nanoql

One wheel per platform, for every Python from 3.11, with NumPy 1.26 or later and nothing compiled on install: Windows x64 and Linux x64 (manylinux_2_28, glibc 2.28 or later); Windows Arm64, Linux Arm64 and macOS on Apple silicon follow in later releases. The wheel holds nanoql's native library, so no .NET runtime is needed.

A first swap

A five-year SOFR swap on a flat curve:

import datetime
from nanoql import ConventionSet, DiscountingSwapEngine, EvaluationContext, FlatForward, MakeOIS, Period, TimeUnit

today = datetime.date(2026, 10, 15)
context = EvaluationContext(today)
qs = ConventionSet.quant_lib()
curve = FlatForward(today, 0.036, qs.day_counter("Actual365Fixed"))

swap = (MakeOIS(Period(5, TimeUnit.Years), qs.overnight_index("Sofr", curve))
        .with_fixed_rate(0.036).with_nominal(10e6)
        .to_overnight_indexed_swap(context))

result = DiscountingSwapEngine.calculate(swap, context, curve)
print(f"NPV {result.npv:,.2f}, fair rate {result.fair_rate:.4%}")

Names follow PEP 8 (curve.discount(5.0), swap.fixed_rate), a getter is a property, and an object's handle is released when Python collects it, or at once by close() or a with block. import nanoql.experimental opts in to the experimental API. The rules are in the bindings guide.

A notebook takes this swap further, to bootstrapped curves, €STR discounting and Euribor forecasting, a SABR smile, an American put and a CDS; it runs in Google Colab with nothing to install.

How it is checked

The core's results are checked against QuantLib 1.44, using test vectors generated by QuantLib's Python package and by QuantLib built from source; the extensions ported from QLNet are checked against QLNet 1.13.2. What the checks cover, per module, is on the validation page.

More

License

Apache 2.0. nanoql is derived from QuantLib. The wheel carries LICENSE, NOTICE and THIRD_PARTY_NOTICES.md, which keep the copyright notices and licences of QuantLib and of the other code it carries, and the .NET runtime's LICENSE.TXT and THIRD-PARTY-NOTICES.TXT, which Native AOT compiles into the library.

Metadata

Release files for nanoql 2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for nanoql 2.1
File Interpreter ABI Platform Actions
nanoql-2.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for nanoql-2.1-py3-none-win_amd64.whl
nanoql-2.1-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for nanoql-2.1-py3-none-manylinux_2_28_x86_64.whl

Total release size: 31.4 MB

Release files / nanoql-2.1-py3-none-win_amd64.whl

Download URL nanoql-2.1-py3-none-win_amd64.whl
Size 15.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
29e6776b0738c58d83f1c5b31dd253f0d0286a999500009ab9235e2986c632d9
BLAKE2b-256 checksum
How to use checksums
ee8f612f16ea9c8e79aa9546600a6e86fc1445a56a1ab1af90080e0a4b7b43db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nanoql-2.1-py3-none-manylinux_2_28_x86_64.whl

Download URL nanoql-2.1-py3-none-manylinux_2_28_x86_64.whl
Size 16.1 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
7d096549fe1be224144c365676428912ff9dcbcbaf3f44c089c45267f8925982
BLAKE2b-256 checksum
How to use checksums
c01efacfdeb34c531b74474e107b704630e47020e3949bdf59e2d0e8028dd2e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for nanoql 2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nanoql-2.1-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page