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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.7.1-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.1.tar.gz.

File metadata

  • Download URL: gaspatchio-0.7.1.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.1.tar.gz
Algorithm Hash digest
SHA256 63bc46cf87ffcd5de0e7afaeebe22252c65ed861609f66dc12d67a5df4846910
MD5 ac94fae2fa3344d6602cc86128518bf2
BLAKE2b-256 e13d12da1d827d1b35664f8fd81e3dabda40ccc9f49f18601cb0df4ca4b3379d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa5e741fe8d78a47a0c5d35c0ccbd4630f0ef4c5b6946ee3d7fc78f6b115e364
MD5 6af2a2cd5cc78b6ef357b3f477157200
BLAKE2b-256 dcb66faecbcd876ddd50ac6d03b13667df618cd3cddcd96da80e76f1fe23faeb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.7.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/6.1.0 CPython/3.13.13

File hashes

Hashes for gaspatchio-0.7.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 47f2ab46390a44bed6754def9abf92c901041ce4976432fdb14b5b939735f3c2
MD5 57b7e5ac895272df0784f3970ada9a9b
BLAKE2b-256 b7820c4b41bdf1aa2fd15cf1de6d640e07fb2f099639c8467f2f7402e1ec4998

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 577d317b4acb9d12cae2b72cf8b8914104c49aea5a8a65176650af5025e1ed4a
MD5 a9bc889d1a2ffcfb1037b3a1c71a956b
BLAKE2b-256 4c668b93cd551ab82de1994dd2b77e3537f42c4faaa2fa16f7c717cfd7ae9d41

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73b563bd074cd6ec50d4c12c9599da1e8928adecdf27f9d11fde940235cfafe4
MD5 48ec3a16aff7cf1f6634f7cdb0c19ee5
BLAKE2b-256 830c8d14e05630b489231421d41206cb454cf768f65a0cacef19a926197810a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 35647bcf2b01b02cc2d7fff54c83627117b9ebee0aad9f340475a124fe4628a4
MD5 4970a60f05e1d0cd4b3e0820c5df7858
BLAKE2b-256 05b7a2585cf6d91f728eb7374f4cabb33ded1ab7d3c01ff2c4d92a1f1e8f454f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.7.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/6.1.0 CPython/3.13.13

File hashes

Hashes for gaspatchio-0.7.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 408bf54c6ff31c663a80d156bb573e31e2717ab4255fb4c621fc4ccd7536100a
MD5 22043254706887cab975aa829f118a8c
BLAKE2b-256 3997aeb77aae8021f4f794235a48e7431ab178e92d91976bff05e3b6698c327b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 df49a943494d39447994f4287e7f5fb660b95199f05df3d4d7964e70475cc243
MD5 608ed1039dde845a3ba87be0dbf0a7f6
BLAKE2b-256 9ce103e4333a9144e0506197462863e44f5067738d6c39c68a62a91cb0c87241

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ab5828f9e0f82a82a763936124cc8aa62e79fe9df95aa521e35ac66de3f8813d
MD5 76568bb3bb32c36a39d07030997e55d1
BLAKE2b-256 c4c69688e859cadea2b926d46fe7c78ed2d754a32688b6a9ee73e1d982dd9493

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b77303963dc440f84c309a069a739d1544900433dfe36d0c78622b6e1269db4b
MD5 57bea29bd4b3b6a7961294fe3cdfff53
BLAKE2b-256 6e5898457375474e08e8b42caeb069ee01055a64930421413bb6a9392fef0869

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.7.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/6.1.0 CPython/3.13.13

File hashes

Hashes for gaspatchio-0.7.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9297f17ddec4be021fc98c1ce6026325556759e5b71cce37c5d68fc4acf8ae69
MD5 cc0b36de5b37c21e5f5af4d5160c14e9
BLAKE2b-256 ffadaa883b60bfd70a3e036ea22f419629b440ad672af758ab21d04e3428f0ee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36d6b295676554663903abd2d9a6f81c1565dbe0fb926920bf2d3ca41faf0df5
MD5 f26d7db7d7c82b6fd7498d7ef4d51796
BLAKE2b-256 0a4723e93baf64625dbd9832ccf5cf86ce04d8d086131ab532d4965323448125

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fea326c40a9f08389ceeab6016a43ef1f0187c55c672ac825bd6842f5ab4cb6c
MD5 a0a671f6c821f1e4da0886e3b86d978d
BLAKE2b-256 ece2c2bc47db6eb5d2a23374c1e6d480570ca56589fefc530d2869cf27a5fb7d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.7.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dd82f50a0d0ce9bad3106e825d247a552061ef451945eb6af62f7efe47995988
MD5 f9d9432d9a439564c2467ba65254d52e
BLAKE2b-256 f581d1028314ef8d68e952628ce40db0c4494cd069a081d2fc71abba44f50808

See more details on using hashes here.

Provenance

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

0.8.1

14 files

0.8.0

14 files

This release

0.7.1 This release

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