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

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.9.0.tar.gz (5.3 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.9.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.8 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

gaspatchio-0.9.0-cp314-cp314-win_amd64.whl (8.6 MB view details)

Uploaded CPython 3.14Windows x86-64

gaspatchio-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

gaspatchio-0.9.0-cp314-cp314-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gaspatchio-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

gaspatchio-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

gaspatchio-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gaspatchio-0.9.0-cp312-cp312-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: gaspatchio-0.9.0.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gaspatchio-0.9.0.tar.gz
Algorithm Hash digest
SHA256 4c5ba463b851543953cb9a50c2e8ac12448b5ccd4e64103e00c044d33d149db9
MD5 29e4e5fa45b26b5b7e637fb87ef6a540
BLAKE2b-256 8842886462ab3b8eec696a9a5056689e10cae3d21b0ae87f28dce192480f1ad8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7898b08f3a73c2b5fdb130cee9e0fd54faaab76a64c1ffdacb3b95a2300ce45f
MD5 61b071b61a678fa111a53d3006e77364
BLAKE2b-256 7c6d604c865782cccf775b4f40737093819ab8f5a87ff4fe3457d97451eae006

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.9.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/7.0.0 CPython/3.13.14

File hashes

Hashes for gaspatchio-0.9.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 4d672e27ee84d0b917d3b74170d2372f72af1d316c3c4f8653b8fb96c0e15164
MD5 61e4095a51d04b049f4ac8356ba4425b
BLAKE2b-256 2349ce917fbc5f4a529334b9e36b3348e5ed4dcc7d81b4027dd64fe17fbe8bae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc8b4a3cd5891972badca3f88c65ba7f5f40ea3814d3be0ff0ec0e080fdc9e27
MD5 2263b4b3b731d29fbaa06d9e2fb639a7
BLAKE2b-256 f1aa70061b2ea42984861934234637d0565b7bb37b5d3fc26caf45ea25200818

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 abbb3e393bb6a2c55013dad7a32df359734edd1ada1d7043f5a8e396ad2c7dc3
MD5 7f0183e2ac5eac2d601976fd02170815
BLAKE2b-256 9f8cfdc9145af06a94271d185b90d7b6c0be6f1f2c27c531c7c1575951e5c2f8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 12b3a93d0f4bb18b0d2f9d382682787acc785dd61309cba3df7484546c721637
MD5 94c1387b89f542a90eceb638bc39997d
BLAKE2b-256 8c1fc8920e0231fe77451da6e51f0ba1e6b4e1cfecc7713f1bb35c6572df7453

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.9.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/7.0.0 CPython/3.13.14

File hashes

Hashes for gaspatchio-0.9.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 abca6b0be42660c0d5caac519947379431e43bd3e8b7702c5fdbb7113560fa0e
MD5 4958cbfbfc483b250ea6cfc4589b490e
BLAKE2b-256 ede2281d3eb450e225224834b3562ea7c64f5327a5700be6980e52446ea7187b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8536aaa053e1ab521dfb127dc78e39a054ef6bf5a74fbafc0529272b7aacd746
MD5 d30eee2d5520187b850a5d8af07c25a0
BLAKE2b-256 6fcab07db9df4f9fbbc5829e1eb217446e21629e2c99654000a04857d810dc5f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0cc294ef78b4d95171528cd24b25234bef122f23261881900e6a01d8d101c865
MD5 611475d4fa3e4e119bdcfddcefb00301
BLAKE2b-256 47c2ded05cde435ee3941ef2fe303afd1b8619c4fe3bc41da3af7f3dc83fe05a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e21d2843d7cbfd46ea892ba756ab4dcdf3e7277b3e6c87279493f3ee4125c63a
MD5 d54b5d0da64c1c83d72d3db677ce4087
BLAKE2b-256 7fce8226cc491a5a8999928338cd752f1abfa3a451884645630092e57ca0385c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.9.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/7.0.0 CPython/3.13.14

File hashes

Hashes for gaspatchio-0.9.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fe1493aaa30c554e3b9e7877d07706ffa56e69d69f796c6707b461c8f00d63f5
MD5 b0364653846139fe8805ade1dc6d60ff
BLAKE2b-256 5247c0f6d76281d941aaadb3d5d3348401d8b1d9b9a6505a77744e6556a6322c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4205c3752cf0a7564fdf205f6905a97641b7e56ba291c3d136b3ca1cf557792a
MD5 f6f15455b76dbbc21605871b34bb1b29
BLAKE2b-256 d2aaf781abcf3dbc02c11f2c64d610756b6908dbfa76d0b448af69e7180a00a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e94a55981f10009bf455e16964e45a87a298889d2097a3824a6d52b1f6fb8a0
MD5 8a0287bb0064965ae81838e00952021a
BLAKE2b-256 2eae02f4bd4081f1980631963347cbdf2558f7a4f51bc5e996c7e43528cbe6eb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fa44829f4d27219954a2362fd810588aa70f13d09fff79d9bf973f9a0167b47d
MD5 52420478e410a16245e20b2cdf6f3531
BLAKE2b-256 af04e49afe93999e0c7545686f64c3b2d9d872fb3354b63e2c2b41e10bc202cf

See more details on using hashes here.

Provenance

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

This release

0.9.0 This release

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

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