Skip to main content

QuantLib Cython wrappers

Project description

lifelib-pyql

Cython-based Python bindings for the QuantLib C++ library.

This project is a fork of PyQL (originally developed by Enthought) that replaces SWIG wrappers with a more Pythonic API built on Cython. It provides comprehensive coverage of QuantLib's functionality, including term structures, instruments, pricing engines, short-rate and equity models, and more.

Portfolio Module

Beyond the core QuantLib bindings, lifelib-pyql is developing a portfolio submodule for processing a large number of instruments of the same type efficiently.

When working with thousands or millions of instruments, creating a separate Python object for each one is too slow. The portfolio submodule provides a set of new APIs that let you create a single Python object representing a large set of instruments of the same type, whose methods operate on all instruments in the set at once rather than one at a time.

Currently, the portfolio module includes:

  • Schedules -- A vectorized collection of payment schedules. It bulk-generates QuantLib Schedule objects from arrays of parameters and stores the resulting dates in a compact 2D NumPy datetime64[D] array.
from lifelib_pyql.portfolio.api import Schedules
import numpy as np

schedules = Schedules(
    effective_dates=np.array(['2024-01-15', '2024-03-01'], dtype='datetime64[D]'),
    termination_dates=np.array(['2029-01-15', '2029-03-01'], dtype='datetime64[D]'),
    tenors=np.array([6, 3]),       # months
    max_size=20,
)

schedules.dates    # 2D datetime64[D] array, NaT-padded
schedules.size     # number of dates per schedule
schedules[0]       # returns a single Schedule object
schedules[0:1]     # returns a new Schedules slice
  • FixedRateBonds -- A vectorized collection of fixed-rate bonds stored as parallel NumPy arrays. It bulk-stores bond parameters and reconstructs individual QuantLib FixedRateBond objects on demand via indexing.
from lifelib_pyql.portfolio.api import Schedules, FixedRateBonds
from lifelib_pyql.time.daycounters.actual_actual import ActualActual
from lifelib_pyql.time.businessdayconvention import Following
import numpy as np

bonds = FixedRateBonds(
    settlement_days=np.array([3, 3, 3]),
    face_amounts=np.array([100.0, 100.0, 100.0]),
    schedules=schedules,                        # a Schedules object
    coupons=np.array([0.05, 0.04, 0.06]),       # one coupon rate per bond
    accrual_day_counter=ActualActual(ActualActual.ISMA),
    payment_convention=Following,
    redemptions=100.0,                          # scalar broadcasts to all
    issue_dates=np.array(['2024-01-15', '2024-03-01', '2024-06-01'],
                         dtype='datetime64[D]'),
)

bonds[0]           # returns a single FixedRateBond object
bonds[0:2]         # returns a new FixedRateBonds slice
len(bonds)         # number of bonds in the collection
bonds.coupons      # 1D or 2D array of coupon rates

Prerequisites

Building

# Build Cython extensions in-place
make build

# Run the test suite
make tests

# Build documentation (requires Sphinx, nbsphinx)
make docs

See the Getting started guide for full details.

License

BSD 3-Clause. See LICENSE.txt. The original PyQL license is preserved in LICENSE_ORIGINAL_PYQL.txt.

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

lifelib_pyql-0.0.1.tar.gz (14.2 MB view details)

Uploaded Source

Built Distributions

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

lifelib_pyql-0.0.1-cp313-cp313-win_amd64.whl (29.6 MB view details)

Uploaded CPython 3.13Windows x86-64

lifelib_pyql-0.0.1-cp313-cp313-manylinux_2_28_x86_64.whl (36.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

lifelib_pyql-0.0.1-cp313-cp313-macosx_14_0_x86_64.whl (30.2 MB view details)

Uploaded CPython 3.13macOS 14.0+ x86-64

lifelib_pyql-0.0.1-cp313-cp313-macosx_14_0_arm64.whl (29.3 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

lifelib_pyql-0.0.1-cp312-cp312-win_amd64.whl (29.6 MB view details)

Uploaded CPython 3.12Windows x86-64

lifelib_pyql-0.0.1-cp312-cp312-manylinux_2_28_x86_64.whl (36.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

lifelib_pyql-0.0.1-cp312-cp312-macosx_14_0_x86_64.whl (30.2 MB view details)

Uploaded CPython 3.12macOS 14.0+ x86-64

lifelib_pyql-0.0.1-cp312-cp312-macosx_14_0_arm64.whl (29.4 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

lifelib_pyql-0.0.1-cp311-cp311-win_amd64.whl (29.5 MB view details)

Uploaded CPython 3.11Windows x86-64

lifelib_pyql-0.0.1-cp311-cp311-manylinux_2_28_x86_64.whl (36.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

lifelib_pyql-0.0.1-cp311-cp311-macosx_14_0_x86_64.whl (30.2 MB view details)

Uploaded CPython 3.11macOS 14.0+ x86-64

lifelib_pyql-0.0.1-cp311-cp311-macosx_14_0_arm64.whl (29.3 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

lifelib_pyql-0.0.1-cp310-cp310-win_amd64.whl (29.5 MB view details)

Uploaded CPython 3.10Windows x86-64

lifelib_pyql-0.0.1-cp310-cp310-manylinux_2_28_x86_64.whl (36.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

lifelib_pyql-0.0.1-cp310-cp310-macosx_14_0_x86_64.whl (30.2 MB view details)

Uploaded CPython 3.10macOS 14.0+ x86-64

lifelib_pyql-0.0.1-cp310-cp310-macosx_14_0_arm64.whl (29.4 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file lifelib_pyql-0.0.1.tar.gz.

File metadata

  • Download URL: lifelib_pyql-0.0.1.tar.gz
  • Upload date:
  • Size: 14.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lifelib_pyql-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8e55cb401c22d15c5bc8e12a8b2284694793a48ef389074bdc440936fb0b0314
MD5 377fea04384f5afbdce5887d582359d1
BLAKE2b-256 4151708b61b1c9089a7d949087320aaab4b8f1805c99ed80dd0aa62d7f25f04b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1.tar.gz:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dfe930ddf68aa2af23f6f0103458883f34c829b2241a1a3e514636eef4e4faa3
MD5 4f3b69647059202516ba639b1710ea86
BLAKE2b-256 275a883d2d4277e26ed7ceef0a29907d8c769e55c38cc15d36aafb872afe6605

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp313-cp313-win_amd64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1c9aa2d95a250ad7dceebb9404035314804e43a2c2e02ecd94ab1dd273857de4
MD5 8f622c9a4a4a752fd3e8b4e9f9494d57
BLAKE2b-256 1c38dd493c38218e8bc9a89ffb36bfd9ea34f0d55cee0637da1dcc08edf19a5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp313-cp313-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp313-cp313-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 bea70d797fd201ea97d0ccf7bc0b294b477dc5ec0e86be527d29d8fb2a6a773b
MD5 c179765d77311727afcd2f418ec00cb0
BLAKE2b-256 46c5561fd9d6af28e2cbbf1aa0fd73112f132d81a702ab2f5da2af4760447266

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp313-cp313-macosx_14_0_x86_64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0f3404a008fcb40a972b601dca329443e9e75306c00a7988c701d54182ca3bc2
MD5 e5b90724add0074d4e4b0552bee55367
BLAKE2b-256 9bb738554b2650acd17b8cccf332017da621cdb9e3d5822704a02937de891f4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a1698c30c57b7c80c593ab697d2cd99526bd54d3ec998b59b0a4ff23ac58b531
MD5 deda2b9a88fe1cbc950be7b0699fed48
BLAKE2b-256 329a0deba0448dcfc1952e3343c2369d23fb77418b19fefa83dcf801d7393ef9

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp312-cp312-win_amd64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c2206546dce9db72660275a30317a7f78e333af9f995895a5ef7d34612debec6
MD5 a70eab86036946f9b2feebe5e2d8a4cf
BLAKE2b-256 a3824d1f09b98badf888fa6f77268f2d0b73db29f53a1068fbd9579a13faf79b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp312-cp312-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp312-cp312-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 eb5452d68141e08dd655486ce2f66848284f089003c2d00ead0eade76dd0ef89
MD5 8478ee84a3c602842b005ea57de7174c
BLAKE2b-256 f3b42dc7fd2c0c28445ebc3bd27e85ccc0f3366cda10771fb37d06c8a7a3e3d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp312-cp312-macosx_14_0_x86_64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 84f37c3565cd0c3343707662a8fb1706eb223c365e59d470e13bb63f8e28fb6f
MD5 4a2ee1fb971289b2467e7253ea42e0b7
BLAKE2b-256 658df629ae64ce958dab722b33cca48cce4b340e80f3c99f9de3d07d19f00320

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c325436c746c8a2eb1569173193d6bff818e0d250c7b72c738b752a25366895c
MD5 4a10683c733b72d5a599edbfa68465fb
BLAKE2b-256 5c1e9a988dba01c6421a2d10efbbe80d18fd90d832181d0be4d7f4ce86e2e91f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp311-cp311-win_amd64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8ba12016ac1c49c01f8fa391c29c5785790cc80a000fb3d3552a233aef9db89
MD5 f1e9b95150f5171b0a99137d5f5c6b75
BLAKE2b-256 ef5650bafd27f879815e40011f590b3726d3616acb7e2b37c8660effd014b859

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp311-cp311-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp311-cp311-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 3f7f15636be80f74e6c43ce33eebe348c481ef038f4093aa4fcecd3cf8a47c1f
MD5 d4b218df2598ad69e742a702001c86ab
BLAKE2b-256 e4df8af98de78ddf16cadf69f547c970d6857cda2b3a865558cd90160a6e34bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp311-cp311-macosx_14_0_x86_64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4ee3d39c216b5a9a48ef0684a667371aba842873521dcfcadf7c1febd8bb822d
MD5 7ca91989324d67656b024870998432ce
BLAKE2b-256 c00b28f7f4f54bd6fc8c6a5a07c047eccbe4d4c4bb96cde7b95f8b55a64072ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f3fa6169bf7e33a56683a41bb895e86236c0e65edca772b114a105806b0a368d
MD5 8d6a0808095ac626a32b70997011b9e7
BLAKE2b-256 2b9af0e2344d3fb4683024ba233ee47f96ed4d02868905cefcc7f3bd6e39cf9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp310-cp310-win_amd64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5b72a7e57126310c5103f3c7034905325c1ff1595035c99a41a33a5c59bea455
MD5 c1c030a058609a36fc13baa5be2a5121
BLAKE2b-256 ca82836f9df3de332d914818d272bece4bf82559d3d0a5fb71b3294e4e2fabb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp310-cp310-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp310-cp310-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 2f66d303f1f67cb367a1b897698e176755dc00077cd70360d681c2fcf13c118b
MD5 05cbab6871f58cfb907bc27fe61f682a
BLAKE2b-256 c6769ef808e62af85e2702354d725d248623bb984c3d7bf3a5b99ee24cb7472b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp310-cp310-macosx_14_0_x86_64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifelib_pyql-0.0.1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for lifelib_pyql-0.0.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 46ff00820262ade7c8b91e44347359a5a72cb9bdcdaf20568f76f4727d432ea9
MD5 3e96a4b83f907736d1676be900e9a3d0
BLAKE2b-256 74592f144de393483fac06d4953ffb6ea93fab2174c65aa14e7225132ae6917d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifelib_pyql-0.0.1-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: build.yml on lifelib-dev/lifelib-pyql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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