Skip to main content

Gaspatchio (Python)

The Python package for Gaspatchio — a high-performance actuarial modeling framework. You write models in Python that read like spreadsheet formulas, and a Rust + Polars engine runs them over millions of model points.

📖 Documentation, tutorials, and full API + CLI reference → gaspatchio.dev

Install

pip install gaspatchio        # or:  uv pip install gaspatchio

Then import gaspatchio. For a source/dev build, see Building from source.

Quick start

from gaspatchio import ActuarialFrame
from gaspatchio.assumptions import Table

# 1. Load assumption tables (registered + optimized by the Rust engine)
mortality = Table(
    name="mortality",
    source="data/mortality.parquet",
    dimensions={"age": "age", "gender": "sex"},
    value="rate",
)

# 2. Define the model — the formula IS the code
def projection(af: ActuarialFrame) -> ActuarialFrame:
    af.attained_age = af.dob.excel.yearfrac(af.val_date) + af.t      # Excel-compatible date maths
    af.qx = mortality.lookup(age=af.attained_age, gender=af.gender)  # vectorized lookup
    af.pols_if = af.pols_start * (1 - af.qx - af.lapse_rate)         # vectorized projection
    return af

# 3. Run (millions of model points supported)
af = ActuarialFrame(data="model_points.parquet")
result = projection(af).collect()

New here? The tutorials build from hello-world to a lifelib-reconciled model and on to scenarios.

CLI: gspio

Run models from the command line:

gspio run-model model.py model-points.parquet                  # run all policies
gspio run-single-policy model.py model-points.parquet 12345    # debug one policy (transposed output)
gspio run-model model.py data.parquet --mode optimize          # optimized execution
gspio --install-completion                                     # shell tab-completion
  • --policy-id-column sets the policy-identifier column (default "Policy number").
  • --mode {debug,optimize} plus display flags (--rows/-r, --first-n/-f, --last-n/-l, --start-at/-s) control execution and terminal output.

Full CLI reference, with every flag and the single-policy result transposition → gaspatchio.dev.

Building from source

The Rust extension is built with maturin. uv sync builds in debug mode (fast compiles); use --release for benchmarking/production:

uv sync                                                        # debug build, into the venv
maturin build --release -uv                                    # optimized build
RUSTFLAGS="-C target-cpu=native" maturin build --release -uv   # + native SIMD (AVX2/512)

target-cpu=native binaries only run on CPUs with the same or newer instruction sets — use them for local benchmarking, not for distributable packages or CI builds.

Testing

uv run pytest                                                  # tests + docstring-example validation
uv run python -m mypy.stubtest gaspatchio --allowlist stubtest-allowlist.txt --mypy-config-file mypy-stubtest.ini

Public-API docstrings carry examples validated against their output. The docstring/style tooling and contributor coding standards live in AGENTS.md.

Learn more

Metadata

Release files for gaspatchio 0.9.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 gaspatchio 0.9.0
File Size Uploaded
gaspatchio-0.9.0.tar.gz 5.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for gaspatchio 0.9.0
File
gaspatchio-0.9.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Details
gaspatchio-0.9.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
gaspatchio-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details
gaspatchio-0.9.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
gaspatchio-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.12+ x86-64 Details
gaspatchio-0.9.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
gaspatchio-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
gaspatchio-0.9.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
gaspatchio-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details
gaspatchio-0.9.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
gaspatchio-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
gaspatchio-0.9.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
gaspatchio-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details

Total release size: 123.3 MB

Release files / gaspatchio-0.9.0.tar.gz

Download URL gaspatchio-0.9.0.tar.gz
Size 5.3 MB
Tags Source
SHA-256 checksum
How to use checksums
4c5ba463b851543953cb9a50c2e8ac12448b5ccd4e64103e00c044d33d149db9
BLAKE2b-256 checksum
How to use checksums
8842886462ab3b8eec696a9a5056689e10cae3d21b0ae87f28dce192480f1ad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gaspatchio-0.9.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 10.8 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7898b08f3a73c2b5fdb130cee9e0fd54faaab76a64c1ffdacb3b95a2300ce45f
BLAKE2b-256 checksum
How to use checksums
7c6d604c865782cccf775b4f40737093819ab8f5a87ff4fe3457d97451eae006
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp314-cp314-win_amd64.whl

Download URL gaspatchio-0.9.0-cp314-cp314-win_amd64.whl
Size 8.6 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
4d672e27ee84d0b917d3b74170d2372f72af1d316c3c4f8653b8fb96c0e15164
BLAKE2b-256 checksum
How to use checksums
2349ce917fbc5f4a529334b9e36b3348e5ed4dcc7d81b4027dd64fe17fbe8bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gaspatchio-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 10.8 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
bc8b4a3cd5891972badca3f88c65ba7f5f40ea3814d3be0ff0ec0e080fdc9e27
BLAKE2b-256 checksum
How to use checksums
f1aa70061b2ea42984861934234637d0565b7bb37b5d3fc26caf45ea25200818
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL gaspatchio-0.9.0-cp314-cp314-macosx_11_0_arm64.whl
Size 8.0 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
abbb3e393bb6a2c55013dad7a32df359734edd1ada1d7043f5a8e396ad2c7dc3
BLAKE2b-256 checksum
How to use checksums
9f8cfdc9145af06a94271d185b90d7b6c0be6f1f2c27c531c7c1575951e5c2f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl

Download URL gaspatchio-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl
Size 8.4 MB
Tags CPython 3.14 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
12b3a93d0f4bb18b0d2f9d382682787acc785dd61309cba3df7484546c721637
BLAKE2b-256 checksum
How to use checksums
8c1fc8920e0231fe77451da6e51f0ba1e6b4e1cfecc7713f1bb35c6572df7453
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp313-cp313-win_amd64.whl

Download URL gaspatchio-0.9.0-cp313-cp313-win_amd64.whl
Size 8.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
abca6b0be42660c0d5caac519947379431e43bd3e8b7702c5fdbb7113560fa0e
BLAKE2b-256 checksum
How to use checksums
ede2281d3eb450e225224834b3562ea7c64f5327a5700be6980e52446ea7187b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gaspatchio-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 10.7 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8536aaa053e1ab521dfb127dc78e39a054ef6bf5a74fbafc0529272b7aacd746
BLAKE2b-256 checksum
How to use checksums
6fcab07db9df4f9fbbc5829e1eb217446e21629e2c99654000a04857d810dc5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL gaspatchio-0.9.0-cp313-cp313-macosx_11_0_arm64.whl
Size 8.0 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0cc294ef78b4d95171528cd24b25234bef122f23261881900e6a01d8d101c865
BLAKE2b-256 checksum
How to use checksums
47c2ded05cde435ee3941ef2fe303afd1b8619c4fe3bc41da3af7f3dc83fe05a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl

Download URL gaspatchio-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl
Size 8.4 MB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e21d2843d7cbfd46ea892ba756ab4dcdf3e7277b3e6c87279493f3ee4125c63a
BLAKE2b-256 checksum
How to use checksums
7fce8226cc491a5a8999928338cd752f1abfa3a451884645630092e57ca0385c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp312-cp312-win_amd64.whl

Download URL gaspatchio-0.9.0-cp312-cp312-win_amd64.whl
Size 8.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
fe1493aaa30c554e3b9e7877d07706ffa56e69d69f796c6707b461c8f00d63f5
BLAKE2b-256 checksum
How to use checksums
5247c0f6d76281d941aaadb3d5d3348401d8b1d9b9a6505a77744e6556a6322c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gaspatchio-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 10.8 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4205c3752cf0a7564fdf205f6905a97641b7e56ba291c3d136b3ca1cf557792a
BLAKE2b-256 checksum
How to use checksums
d2aaf781abcf3dbc02c11f2c64d610756b6908dbfa76d0b448af69e7180a00a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL gaspatchio-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
Size 8.0 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7e94a55981f10009bf455e16964e45a87a298889d2097a3824a6d52b1f6fb8a0
BLAKE2b-256 checksum
How to use checksums
2eae02f4bd4081f1980631963347cbdf2558f7a4f51bc5e996c7e43528cbe6eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / gaspatchio-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl

Download URL gaspatchio-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl
Size 8.4 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
fa44829f4d27219954a2362fd810588aa70f13d09fff79d9bf973f9a0167b47d
BLAKE2b-256 checksum
How to use checksums
af04e49afe93999e0c7545686f64c3b2d9d872fb3354b63e2c2b41e10bc202cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

14 release files

0.8.2

14 release files

0.6.0

14 release files

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