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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.8.1-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.8.1.tar.gz.

File metadata

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

File hashes

Hashes for gaspatchio-0.8.1.tar.gz
Algorithm Hash digest
SHA256 8615fe8d8a666c04df547ef38cadbe0109bcfb198d3f77ac9fc078028d1bd955
MD5 ad9685f355de4b2428d2e5498764a748
BLAKE2b-256 b84c3b2266dcf464b009c6d2c53e94867586b3f72bfcbace1e99e43a7f65f729

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 db841cf1349b4f3a9f52691c7fb5b33754dd4e0be2b5e326b3acd745b9622ff1
MD5 57e450c1520c3261af55b592c4c91461
BLAKE2b-256 95a47648654df9f30feb95faae6e59b0a96b6d7cdeb9bd810c249973c48a6026

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.1-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.8.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b7571f6cf6636728a71f3a2bc2b8b303742fadb8fa9ede9654970129893f27ae
MD5 4e6a9b9adab3b29710457df54e4c2183
BLAKE2b-256 00800eef0166ca8d24bc68d69e30f8f645cca59d4b11b84fc7fa095a399a31e0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 548e5ec2b1733b976ba120eba42dd9c6c8c6ddb2f4749659786b2b15149f332e
MD5 612b7bc0bdcf7c8a227add02ee814b9d
BLAKE2b-256 c452e7723ba18676af9f4bd2702092957ba95520cf0dd759566e9c127fd52945

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0340207160877f45ace39541382667ac0d4daa893605f131d8b5c26b533f01a4
MD5 dcf29e35cfd89fec98a23ffea7ff4a64
BLAKE2b-256 ba2d9e83848fa5d1fbdd23187912720658b12c02f0485ad96f6ee08cc614ffa2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 db3b39b2933107ad69734c5fc4bb3644ddd8f5934e29abf21eeb29c23e71a64e
MD5 b6833dcffbd741f4854b2495fae87529
BLAKE2b-256 57d02f6544076cd9ceaf2a48ef2ac80d5dac4304f5264cddd2e87ab2f11752e2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.1-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.8.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b0d7d610d058eb79008c552e49e0704520210b0cf074d329645c65af41038b41
MD5 09b94208d923849c405fe8eb2850ad85
BLAKE2b-256 1ecc21c9f6c5419027a03999ae9ae535278d1b24e198e4dc6f15ff308762b945

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d9f20090378df692acdb5f260d98e4a52bd932a38e8f1236ae22f00f0f59b6df
MD5 ddeb02d371a2be3bb97bc5a79c480d30
BLAKE2b-256 3bfebf033aef6df26e1a1431ec752647a37d8751ed4956a3feee83899f087dbb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1996d25ced4225ac9a84e4c8ac3e76c3f049d81420998387d5dac7aa037ffa86
MD5 356dadfe23db4d1292bc5dfc5a754bec
BLAKE2b-256 6eaf63a575af0a844a786390a851b0505f894ecc2b69aab17cfdbc202d5ebeed

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 60eb346b0bf9515d11f29ba1bbb093312cdf41f48d4d66ce40823408f01f1629
MD5 82b9dddefac3266a39d95e32be7a7609
BLAKE2b-256 620407f3e95908a67c911def59c5fc797f0636f7f6c39d6911d2c83997271ad9

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.1-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.8.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 26a1f9b68ce6cbcdb5da21fae4310ee2081d223c0028f05b26044e9bccf3e6fe
MD5 9bd018f24c9a232bd45b5a71df58e0fe
BLAKE2b-256 4df0cf2bd056079d857a12c5bb1848bd890fb7c550b799e6edda5aa8a0c18042

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3cedb65e2ba8e6dbaafacce305dd35323f4d4fe0da586ee16ffdb841da8b2f4b
MD5 944e3d640f519c4cd6f991fbd90970e5
BLAKE2b-256 8d146ea8f0f191b528c5ee720001be8035e8758db0b00abed1cf3897bb82bef9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b26afdbbd7a63a39d1ea48059fd89be619c850586337029a5678677d8c954394
MD5 cb31ea695f1c06a36bb0896ac8222a48
BLAKE2b-256 85c45ab40bf141e85f3ab63433e7954fcb62e033b38c35fb2b655ee4b906f632

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2a073ce5ab557a40a5caeea3c6862e024af2d25ed9461b807c7f45adfcde9bd5
MD5 380ae9281f7b9af544cae40a21c4a7d2
BLAKE2b-256 a2c4dac849bd44ffb05b3683c13f342a9c0f4864eb3bea5c2b145edb1b0b8c8e

See more details on using hashes here.

Provenance

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

This release

0.8.1 This release

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