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.7.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.7.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.7.0-cp314-cp314-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.14Windows x86-64

gaspatchio-0.7.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.7.0-cp314-cp314-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

gaspatchio-0.7.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.7.0-cp313-cp313-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

gaspatchio-0.7.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.7.0-cp312-cp312-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.7.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.7.0.tar.gz.

File metadata

  • Download URL: gaspatchio-0.7.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.7.0.tar.gz
Algorithm Hash digest
SHA256 cb2912524ce2b351c722341529430f3db2f9d6ba5d4ae885cdb5346494f5fc16
MD5 d91f0c0a6fa471309d27f4fb322846d6
BLAKE2b-256 3ec199a26bb97119f53307510768a808730a52887edc15c40668c5efcd84f534

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6ade6c5247a68ae37dcc52aa57efd896d56c6586d480b204b8145b5c135c3af1
MD5 e4a2028f1ecda896d5aed4c26ce6d33a
BLAKE2b-256 87ed232dd8268649bd4b47d75626d51af2e14cf0992a3d51d3ca58acf7612277

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: gaspatchio-0.7.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 8.6 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.7.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 28fbd6c33057295540526e667c2ca21d760839543add528de2eb3eb0ceb58139
MD5 dae4def368ca14091186e884f154704b
BLAKE2b-256 c52dffb6071a2d28ca18b212a71234ffba3068c4fed2ff770e108a8c9da6ac59

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 465c95354c44c48b64a04789bed6f2e6459455e3fc46eae795f1457ccc8e2031
MD5 e45eb9a83c4db6935850854ccbf50894
BLAKE2b-256 021d7d9cee6589911ed427e562b1aa1f028bbbaa20a13745fb8cfabfa99e0151

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e065a04f965a5cbb6b6103c0bf2b20d7f703c519814faa2be67f95a47127933
MD5 478288d9918f745fc28820bf320abe89
BLAKE2b-256 b724bc7a7800c376409c0ccb4f5f6d2537e1acb78a50e3362d974e501f81e24d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7bf23bfbc84aaa3cf0599d441fb7f87cf7ff891ead6dab0e1859d15a850f8e54
MD5 aa1362fe1272d4e0a4613f4314faf9a9
BLAKE2b-256 a3fa3f88dff74b7329f38850bd38e5e2e713354446662c0bb5f360d3d32762f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: gaspatchio-0.7.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.7.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cc8f4a21cc6914931e648cf3a6142f8783c3a30e6a921cf2115a36f5f2f54166
MD5 9d05657171444de989c1d8d1e5c8f2e2
BLAKE2b-256 0a61228e8c714ba8c872437720163dac0b05583b76d7412364cb3331ad217b0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4fd756218ec20aec1b34c1bd2039be314a8d9e0344510f30c70ab8c99ff30c0b
MD5 1d9076adbf25ae8c20a024c7325656fb
BLAKE2b-256 5c0abb5acfd8a31df0e2e2955bfe3f6a70d6e40bba86f44264c51a0e8f49b124

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6622549c4495fc1611ad93c5052d3b2d042988ea61fab3f6b70d3b575e836fd3
MD5 eae64f98d0f50fdc886ede638936146d
BLAKE2b-256 dffca8dd8f166e03cd9a6b4c86d51fbf833545ec08d22ea5923a826ce3161725

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b58b39fd9285d886a9a18001109272975c32f5bfb3ac00f1562db451c66a94a0
MD5 a9fc3a768d73518efaa604a509fa3886
BLAKE2b-256 3dc18ef11fce8ea7852e97b9fd817a4c8fdf75f095bb39d571b8c60f3e351a75

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gaspatchio-0.7.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.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cf60ece9befc7620d7ffde1c3e8248d57d3b1f4ea72f54c23eeba568248a9198
MD5 4ea55b491bd5f638cada57d8a6e3f634
BLAKE2b-256 4ec21607679d7ad1b1555c0a05cc3d1f673b068f7a77e7deb06f7afd0040d078

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95dd7181748fabacf28405d12292afcbb1666a11308fbcf6a8076efd4c17faea
MD5 570c49adf663f9d0141c3cf08339ba3e
BLAKE2b-256 3f6a790edf9fcec24a7ca7c53b4ddfcda8bd144fadc4f9296bb3f6029d4bff61

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0451dbfde358571807d86cabe8bacb21014fbf584e57eb4ae672244567cdcb52
MD5 4f65c03bb634228c20bb06b666eac5c7
BLAKE2b-256 5c0bef449d3a8e3187c7d733157eee76422f19a37f11aa380c4a275b41644434

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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.7.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gaspatchio-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 396c8e0e8d568fd2d07fb81dcd91d1fda6e90d4496740b79fe3a7d7d97ba6667
MD5 d0556ad233771ab75f7ed0a51df43725
BLAKE2b-256 bdfa2652298d3cd90d89c376c5b603148eea13f7e59f69bd7b9755259541c01c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gaspatchio-0.7.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

This release

0.7.0 This release

14 files

0.6.0

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