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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

gaspatchio-0.8.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gaspatchio-0.8.2-cp313-cp313-macosx_11_0_arm64.whl (8.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.8.2-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.2.tar.gz.

File metadata

  • Download URL: gaspatchio-0.8.2.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.2.tar.gz
Algorithm Hash digest
SHA256 55fd919c934af2917dda999938c8b1807d7f6854e309f4de9c18ca824c8055bd
MD5 69caaaa5877b80d0553426addfd760c4
BLAKE2b-256 2add6e4df8728b60958911b1166cbba89722b59283346ef058e761ca62c9e355

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 831491f62e521f6046fb6575eec27d330ef12357ae8d344e95fd1351fb4449da
MD5 eda0d1eb92feb580385cd3f9ba752482
BLAKE2b-256 b903fa358500f68e48b08749f474b0bd6e90604e4f98deb78b5a42132bacfb85

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.2-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.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 013288985c8e95a859a26b1790daaeec773fdd90bd9f44c58e2485d7461abd10
MD5 f79f4129e2f70f47cd8f03014bc37072
BLAKE2b-256 77da00f0213f7aff82b072a696f113f15a1ece5dfb1db53094d90e9023fdca56

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40de3bd83d52cb7efe364bb9242839cf9fe7c8bdeee96a38609a8481de34fb3b
MD5 2da3ef111051e88811e4fb235226c128
BLAKE2b-256 c0dfa727d5ce5aa0455a4b48332cb340629e6696bb274b35e134bbc944344006

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b9d435319dec92db1459b54a82f06024113459ff02384d865d7d05c961be6562
MD5 bd3727aff3cb73037ac1d9e2ef3d0182
BLAKE2b-256 b344d0256cbbc0f4a3c4e0548b4ecf5747440809049056ad9f84d79ded123a43

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7e87faa773cfd95c17f331740a3e5d689869d7a2aa849128cc1775d1d37c74d7
MD5 16a4b330ef617b0f38b5210c79b57256
BLAKE2b-256 2dcac4546ee97832d5104ba3742128e9e432a33ebb5b2bba9c67444fb400ffb8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.2-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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 26d52a9e196affa16245e424dfc1a3403763caedc28dd744cfed3449643df460
MD5 ed2bfbdc5f7bf8ba41357da1f9a5216e
BLAKE2b-256 da7c3e400442610a6277fd1d9244149727528776e21311ce550b70054d7f7733

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6cbf8c2f295057b00c0c83a3cb670590b8d9418fb50cdcfe2c02e744d9ee00d3
MD5 25b86c8f8b57895de5b54f1b0010ed48
BLAKE2b-256 5ca5feea9b610edc6fc9490f44b4f2da4f40698bf92756b0c2db06fb6f6aef44

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3cf955e6fc7a2db67b3339f3b0240383b516637644c8d066a45043ef3eb81c6
MD5 34e906f3faa0abd029e84e1069f5e575
BLAKE2b-256 4d212a56bf51264ed707bf4d64ffef69ad07547c0c02443c8d2ec4aa2d9825ad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 46cfd02ce3cf6dd683c094a30d52ed3331a420e529d0b58adf8e5644600f903d
MD5 3512a61741fd613ddf5199ac0f1f515d
BLAKE2b-256 56a3d015820d999085f16a1be3bdf0ca16ce4628ed88dc5dff4d7943b67ee4a5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.2-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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c6a38b80affde28253d72a35b78fa459c45ec2960722545fae901d0ef6d30a25
MD5 b4f6c0a02b019c92eaa5e5cb2acaceba
BLAKE2b-256 6d4232776e53725fb10a95a7f7df93e59a6a3dfc0d50d5a1cc112bc0c41982c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bbf589e462fddf5dcc8fa9da6a8bc54db905f7924ee6f2177b8e300424bc42b4
MD5 60781595c950735c37055e75c28c29fc
BLAKE2b-256 76cba6a655c9e394a7b57d6bf27bee567cf4cc0b71ca7cbfdf58bc0a427c9f4a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9a491ac8b66cb19531ae472c36531c5170fd89870f9867515465d15016534ea8
MD5 54d1482b7adff964e554c15c758ebe32
BLAKE2b-256 274330f94878ddd770dd2a9e08d7c85bee63d7987334cb721757fb4e3799557e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 acac5a0758043a539bc0ec1c9fdf16e93aacd6795807414574a87ce895ac9a97
MD5 5839ce495738b8efe1058279b0d7e238
BLAKE2b-256 f273a5acb7d9fc032ce05e13f6d635c3c6a8503ac3952e50d8c4661f072a4f0e

See more details on using hashes here.

Provenance

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

This release

0.8.2 This release

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