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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.8.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.8.0.tar.gz.

File metadata

  • Download URL: gaspatchio-0.8.0.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.0.tar.gz
Algorithm Hash digest
SHA256 f3d1ce1cc3d5424862c315f846cb3523b5925038ffdefb34aed5a7ff8cfd2bac
MD5 664069854751ca59f14afd331714c3de
BLAKE2b-256 b3f8456c668c0790aeea72f8a8d4ca4bb2d769d2082d35a59317aed19ac68a25

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75829840584a1952ad75c081c0a7b25bdfb4ff4648a5efb6864c8b620817c3ef
MD5 147df16436590e97a53d5cafc07c3ecd
BLAKE2b-256 abdd9ce27d9d2de5727da4cb03490ae896dcba995edec8926b201b8be29ecd2e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.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.8.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 74c4b02d48d6e95ef6a96bbd2ae18c5901b0fcf3a9f30d425154e9de6c845bea
MD5 b2bc890c19607fe608bdee204fa8f614
BLAKE2b-256 2abbc6b8025b7c88faaae5d51b3eab016db4db6d64324233f054b3d4dc533674

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0f1cbc6e375644ee58e25721719835063cb68d56d8e1c35400838b6e1546cdac
MD5 cfdd2d9e55b0317d5d25b944a75603c4
BLAKE2b-256 257f91efce5766b108a870875dd172a544f6e0e49c76ea15bc92aa300b361ace

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b177f872a2b9f53059e19042f4e7e73c584b7ac1fd8141f0836d67b2e11b29b6
MD5 48d41c12757ae230cd39b55b3f60bca3
BLAKE2b-256 fdaa12ac0f4f13f4dc866efebbcfefb3a2fedd7e7b391665b3a009477783de8b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0b68885273b6b464bc5e1a5e204ac93f522c36bf6394a238040b3071c246261f
MD5 8e3ea05cdde9ef88e4b1414f3e604213
BLAKE2b-256 e911470e068d5ede83b551931fcedda90989f9aaba5e6d1a3e9851ac5d5f52a8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.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.8.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5a68700d5312cdc80f74c0bd2f0a5da154d49885dbf1c8840d68928948f57362
MD5 a4cc2d75c9af74ef4fb81e8200922ab7
BLAKE2b-256 fbabf4558dd5a661b8a81db74dab98a2f6432295682cea0e8a6c0ed35a041c12

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 adf96c6a256018406e51a22eb48b35de226947876eea9125f4f34ebedb1a24bc
MD5 e1747acfd5889903e9151a5d2300bfff
BLAKE2b-256 9f223ae705946f309b64c3da2e271aeffa351fe649db86b7f7c3cfd2a23410d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6290d1c38c38dc49b9640447f6b04098b3f5685f0b6e241cb99186c3ea9d987
MD5 48244c164def918cd32eb6a46a3d96f6
BLAKE2b-256 b9dd57a8819756436c7e36ea7ba2f29b6c34d6c399a7011d51981f5d1fe28e3a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 77de17273e88c043397a646729517618a8d7188c2643883b07a9764382d0f91b
MD5 6943640c18108303fbba3c909b5eec79
BLAKE2b-256 73f7cf28394c39b29a35a298014c8539a9ccaab4faba7be12f5efe325eded296

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.8.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.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 75d1a8ee85497a6a2970ee78c48d385f5d19f3b3dbac4bf4c51faeca2215901a
MD5 d63887080845cdb8781cd5a44703df77
BLAKE2b-256 5aa4c496aff8c15c0145925b18436d2c854cfa8cf7c75f7022ccd289437e8f3b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e572e69165573df14a7d60219437ee0792fdaa10c27534ea2f9b1cf8399572c
MD5 be0471094450fade93e8fee1032b4383
BLAKE2b-256 ac50faf24a7bce873c733ba5156f1c10df502c6d4bde0056a199d09a661c380f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b0770bdfcfcc79f998a3321bb806505bf4f1b070728baf5efd90b1ab77fb6e07
MD5 06ed2288f19c35ca1623bfe68c1d17b9
BLAKE2b-256 b332f53705be0d28e9ad60e834e6d042d0fccc471325677e02b60e25147b99a3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.8.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 547d7a9dfe749989cda7d57b6ddc8c43d73ffd748fde0554df6c45c384984b1b
MD5 f57eef034e84d6d5006550d430cdc219
BLAKE2b-256 03098223a79e3d49570ccd32fc26d86c0c4ebd989e23d48963ef0f918481a36b

See more details on using hashes here.

Provenance

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

This release

0.8.0 This release

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