Skip to main content

quantlib

PyPI version CI GHCR

Minimal, self-contained CLI tools and library for quantitative finance.

Subcommands

  • corr: Compute correlation matrices over time from returns.
  • costs: Calculate Sharpe Ratio (SR) costs for instruments based on spread and fees.

Modules

  • estimators: Volatility and Forecast Scalar estimators — contains robust_vol_calc and mixed_vol_calc for daily volatility estimation, and forecast_scalar for scaling forecasts.
  • accounts: P&L calculation framework — contains account_forecast for generating P&L curves from forecasts and prices.

Install (editable - for developers)

From the repo root:

  • cd quantlib
  • python -m pip install -e .

This installs the quantlib command.

  • uv sync --extra dev

Docker

Pull a published image from GitHub Container Registry:

  • docker pull ghcr.io/rodionlim/quantlib-st:latest

Run a quick correlation query by piping a CSV into the container (one-liner):

  • cat sample_data/returns_10x4.csv | docker run --rm -i ghcr.io/rodionlim/quantlib-st:latest corr --min-periods 3 --ew-lookback 10

When publishing the image the Makefile also tags and pushes :latest in addition to the versioned tag.

Package Sample Usage

Correlation

import pandas as pd
import numpy as np

from quantlib_st import correlation

# Sample data
data = pd.DataFrame(
    np.random.randn(100, 3),
    columns=['Asset_A', 'Asset_B', 'Asset_C'],
    index=pd.date_range(start='2020-01-01', periods=100, freq='D')  # daily dates
)
# Compute correlation matrix
corr_matrix = correlation.correlation_over_time(
    data,
    is_price_series=False,
    frequency='D', # resampling purpose
    interval_frequency='7D',
    date_method='expanding',
    ew_lookback=50,
    min_periods=10
)
print(corr_matrix.as_("jsonable"))
print(corr_matrix.as_("long"))

Metadata

Release files for quantlib-st 1.14.0

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

Source distribution (sdist)

Source distribution for quantlib-st 1.14.0
File Size Uploaded Provenance
quantlib_st-1.14.0.tar.gz 171.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for quantlib-st 1.14.0
File Interpreter ABI Platform
quantlib_st-1.14.0-py3-none-any.whl Python 3 none any Details

Total release size: 403.8 kB

Release files / quantlib_st-1.14.0.tar.gz

Download URL quantlib_st-1.14.0.tar.gz
Size 171.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b6cd34dae3c62eec55738d7e735cdff9b0d66564f9486a51165e3b93f9c04285
BLAKE2b-256 checksum
How to use checksums
3daa1d64cca34f09fab6950b7e96f98ff72282d6f22edbb55654dbd42f4d3bee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / quantlib_st-1.14.0-py3-none-any.whl

Download URL quantlib_st-1.14.0-py3-none-any.whl
Size 232.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e84138baa48f1938a4de71b3d31d28cca3d711d345bd9d0828c991b77b5ce56d
BLAKE2b-256 checksum
How to use checksums
4285ff59d10c31a43d7a14ee03096df4fa1c68097495b0ce3d1c9fb2ad6e368e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for quantlib-st 1.14.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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