spxa
Stochastic processes as first-class algebraic objects. Exact Lévy–Khintchine arithmetic, a differentiable computational graph, and reverse-mode Greeks.
spxa is a Python library for quantitative research. It treats continuous-time
stochastic processes as first-class algebraic objects: compose them with +,
*, @, and their Lévy–Khintchine triplets add in closed form. A computational
graph engine compiles pricing pipelines and routes to analytical, Fourier, batch,
or Monte Carlo backends, with reverse-mode autodiff for machine-precision Greeks.
Install
pip install spxa
Dev install:
git clone https://github.com/Nityahapani/spxa.git
cd spxa
pip install -e ".[dev]"
Quickstart
import spxa
from spxa import VarianceGamma, GammaProcess
X = VarianceGamma(sigma=0.2, nu=0.1, theta=-0.1)
Y = GammaProcess(a=1.0, b=2.0)
Z = X + 0.5 * Y # exact triplet arithmetic
print(Z.exactness) # ExactnessLevel.EXACT
print(Z.triplet.sigma_sq) # 0.0
print(float(Z.triplet.b)) # 0.04072233534646699
print(Z.exactness == spxa.ExactnessLevel.EXACT) # True
| Module | Purpose |
|---|---|
spxa.core |
Process algebra, Lévy–Khintchine triplets, exactness lattice |
spxa.zoo |
69 stochastic processes |
spxa.graph |
Differentiable computational graph & autodiff tape |
spxa.diff |
Greeks, pricers, neural SDEs |
spxa.calibration |
MLE, GMM, Kalman/particle filters, surface calibration |
spxa.copula |
Archimedean, elliptical, extreme-value copulas |
spxa.control |
Merton portfolio, market making, HJB solvers |
spxa.pde |
Finite-difference PDE/PIDE solvers |
spxa.rates / spxa.market |
Curves, swaps, bonds, bootstrapping |
spxa.vol |
SVI/SSVI surfaces, local vol, rough vol |
spxa.rough |
Fractional volatility, rBergomi |
spxa.morph |
Model morphing & barycenters |
spxa.geom |
Information geometry |
spxa.signature |
Rough path signatures |
Docs
Citation
@software{spxa,
author = {Nityahapani},
title = {spxa: Stochastic Process Algebra \& Computational Graph Engine},
url = {https://github.com/Nityahapani/spxa},
}
Contributing
See CONTRIBUTING.md. Tests and the full audit suite must pass:
python -m pytest tests/ -q
python audits/run_master_audit.py
License
Metadata
Release files for spxa 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spxa-1.1.0.tar.gz | 5.0 MB | With provenance | Details for spxa-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spxa-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for spxa-1.1.0-py3-none-any.whl |
Total release size: 6.3 MB
Release files / spxa-1.1.0.tar.gz
| Download URL | spxa-1.1.0.tar.gz |
|---|---|
| Size | 5.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9df1323b0845a48de068daaf294e23f7d7f59038c3ad0621ade14b4d4fe561e2
|
|
BLAKE2b-256 checksum How to use checksums |
80c576c61f70da7e7ebf6f27a0cfa9f914fed36e3d1fad556dbb728515d3cead
|
| 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 19, 2026.
Transparency logRelease files / spxa-1.1.0-py3-none-any.whl
| Download URL | spxa-1.1.0-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3448c04ed7e2735ac801ccdd87d76955a35e8de9ebaa6ca46c86382b3dfd237a
|
|
BLAKE2b-256 checksum How to use checksums |
8e05acecb829afbe42aea45fa7de2794b5365459af37f1b1cd2efd00e71f6ff7
|
| 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 19, 2026.
Transparency logSecurity for spxa 1.1.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 spxa-1.1.0.tar.gz
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 19, 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.