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_core. For a source/dev build, see Building from source.

Quick start

from gaspatchio_core import ActuarialFrame
from gaspatchio_core.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_core --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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gaspatchio-0.6.0.tar.gz (5.2 MB view details)

Uploaded Source

Built Distributions

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

gaspatchio-0.6.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

gaspatchio-0.6.0-cp314-cp314-win_amd64.whl (8.5 MB view details)

Uploaded CPython 3.14Windows x86-64

gaspatchio-0.6.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

gaspatchio-0.6.0-cp314-cp314-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gaspatchio-0.6.0-cp314-cp314-macosx_10_12_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

gaspatchio-0.6.0-cp313-cp313-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.13Windows x86-64

gaspatchio-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gaspatchio-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gaspatchio-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

gaspatchio-0.6.0-cp312-cp312-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.12Windows x86-64

gaspatchio-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gaspatchio-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (7.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.6.0-cp312-cp312-macosx_10_12_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file gaspatchio-0.6.0.tar.gz.

File metadata

  • Download URL: gaspatchio-0.6.0.tar.gz
  • Upload date:
  • Size: 5.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gaspatchio-0.6.0.tar.gz
Algorithm Hash digest
SHA256 7c3dbb6d0c160ffee113d8d3dd1278c8ce11e4383b65228ed173bc837c24682e
MD5 7fff52abd18e5a7fd12f416708eee566
BLAKE2b-256 27cecc3dccbef80b7b6755e4cd91846e0d328c52fee4f77fc3e11dc22209b73c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0.tar.gz:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ffb71049cd2b4dc9f1ce67cd442d40e49a6186be3e202a7d37808c4b35e992a2
MD5 f56606b19c2dcb2e05bfc77e7269318a
BLAKE2b-256 462bfcb6eaca7f045d0d8dbcfff660593308fd1864d6312498eb3480b13ad07e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: gaspatchio-0.6.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 8.5 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gaspatchio-0.6.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 91477c567d0f0f36c0163d4684ce07a07383a2eb6219c141e0d69a2c8891b901
MD5 d93755f5a9bce070f8383c3c87430d4e
BLAKE2b-256 622f0bf05bf6215183a01739df622556a25d8421445885cf1d4fca671c789e64

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp314-cp314-win_amd64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 864654d4575824648771620152272c61fcaa5297c402b032bfb1796387130f20
MD5 88792b08d0191c2eca601f797467d7db
BLAKE2b-256 4a1506a6e504165425ee17263e5327b1783c91b79fcc064c9942f2ff316071f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 800f06dbeb7a5cbfe950870ca46eaba2d634594279877ca077534f19da15aaa7
MD5 9d572774756d7f1d8576ef1478b43230
BLAKE2b-256 0aa03eb3c587d1235979a34e214c03134004298e624946605c8a726c1369686e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 693fcb7dace4d44befa5f36bfa6e43cf0c64f48cba8eb8f1e446426a57b35c94
MD5 7bfe40b38c1ff71c3240ac86fdc04845
BLAKE2b-256 905a43a60fc740b6bf8cd2a7e6ef7bdec819ced07619f116d3a66f8b79687323

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: gaspatchio-0.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 8.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gaspatchio-0.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b14999724f46c185d9205c0862539c3c345fd444120933f3f46d0bfe410ac9d2
MD5 7e4ad8ea18f2d850d4c2dc7a94c0dd58
BLAKE2b-256 fe7299ddfd90dd4b9684603f1fa1a0cb8c85165000eee4ea332c8503476a30aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp313-cp313-win_amd64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d196730da536c51b4cc7267a8f91faa6493da554734407c2a961237f193c98de
MD5 63db6578d7ae0a4676655d4a7527eaa0
BLAKE2b-256 f366f67ef6baf8838265ffec3d2544c3f15c4c944b5867f47b5ec64f3fe98b17

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e037cb4469921cefa98660e71f26969ec6db422ab7e83d7d442393218c22e2b
MD5 cf633ddb2157e854a36b57a5ed03d228
BLAKE2b-256 245bf0d1ab355a8792d38dd2c4dd56182ab499337be3593c8d6310f974bb7fbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8b80c2505c11b9a10b8c021b288bd89ffe23637b8e35147cadd72198b6b1a22d
MD5 29fc6cbdf9093979ce647a409830a181
BLAKE2b-256 eebfe34ba4954206bac0d875ad0bcf7caca6b2190060edc242219bec187ab60e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gaspatchio-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 8.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gaspatchio-0.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fdee28a6e2d5183f0fe5c477f74fb3b7577271fc940c1338fb49c5316db6fd1d
MD5 d03cb7ce8aa5b044006ab1dd782d44eb
BLAKE2b-256 36d2883ea245482dd0bdc9b86669ef62e3f706f60f44273099c694b14bacbea0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp312-cp312-win_amd64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 93b5d97033317039f9e825378ccecc776db1cf99765f495960fe63f975e864ed
MD5 9c700bf39465b56c292e3328c1bd061a
BLAKE2b-256 04da0afbcbdbdaacc1d25f717d426c67c11f577604431ea6394e2b35da98bf10

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8cf08198e01f8126f70ed871741af52ff1eca3a1b4aeff8a44106fed5f92aa1e
MD5 a31650df71a189c44980da390631aea8
BLAKE2b-256 ae12e2f9bf3dad8e154b3cfd3cc88dd17a1871374db952b949fef67270cec040

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

File details

Details for the file gaspatchio-0.6.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.6.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6470479883ef1a45e2e2fda65c9df8cbdcbf2e92edf0b22d31fd378eaa5e4b43
MD5 371dc3d0110a5abd378c0634b9e8aa50
BLAKE2b-256 2b8ae3af5423d3ba3874328c42a4ae4c2b3bbb76f966354c33319103e400332d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.6.0-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: CI.yml on gaspatchio/gaspatchio

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

Release history Release notifications | RSS feed

0.9.0

14 files

0.8.2

14 files

0.8.1

14 files

0.8.0

14 files

0.7.1

14 files

0.7.0

14 files

This release

0.6.0 This release

14 files

0.5.3

14 files

0.5.2

14 files

0.5.1

14 files

0.5.0

14 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