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.
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nanoql-2.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for nanoql-2.0-py3-none-win_amd64.whl |
| nanoql-2.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details for nanoql-2.0-py3-none-manylinux_2_28_x86_64.whl |
Total release size: 31.4 MB
Release files / nanoql-2.0-py3-none-win_amd64.whl
| Download URL | nanoql-2.0-py3-none-win_amd64.whl |
|---|---|
| Size | 15.3 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d118a2fa923f5f830a554c13d2b86184897a06cb74cd5c38d5c234c6f111e0e9
|
|
BLAKE2b-256 checksum How to use checksums |
9d6c7803b2120de30ef4773083ba11658635b839beeee07547285dd2f1c555e4
|
| 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 5, 2026.
Transparency logRelease files / nanoql-2.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | nanoql-2.0-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 |
31668f3d36007e35a6b61aafa49fae626e24b2ed80404bcc659c5d1ce916b865
|
|
BLAKE2b-256 checksum How to use checksums |
6097be15c67ed6b5a6a7996e7ce3b0f87a37396ae190a84cfe3f3b166456579e
|
| 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 5, 2026.
Transparency logSecurity for nanoql 2.0
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.
Attestation for nanoql-2.0-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 5, 2026.
Transparency logA 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.