Skip to main content

Simple, fast and best served cold

Project description

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

Project details


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.5.0.tar.gz (4.9 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.5.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.14Windows x86-64

gaspatchio-0.5.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

gaspatchio-0.5.0-cp314-cp314-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

gaspatchio-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gaspatchio-0.5.0-cp313-cp313-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

gaspatchio-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gaspatchio-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.5.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.5.0.tar.gz.

File metadata

  • Download URL: gaspatchio-0.5.0.tar.gz
  • Upload date:
  • Size: 4.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gaspatchio-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4c4c89256b7c2d2d1564c2a3ab8949290cb0683d2f145bf9c2dd84154f4eda56
MD5 929c83806e96f0364ce5ae284ac801f7
BLAKE2b-256 f6c7c409e453ba4ebcf8adbea9e136dac1ca02862626bfca41c1ed237501ee94

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98e404cb44fea09e2d49aff4c9ae1b135e7bf44d48b447081d54702eaeb17e4f
MD5 c1f9e75c0401a507ecea20050c5e3e04
BLAKE2b-256 13535f1c80057878750a323a9b581d30027347cb586455e4c392d04989057515

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for gaspatchio-0.5.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 501614241e631094ec3620d3446c5587e69debcc401be7d01de974e89546c394
MD5 18c6337d499933663b816f9cbf2a7552
BLAKE2b-256 9318c6033a8dc5d356d5b86b2d0a9f61a58f6466ed69904e93bbace2b2071d84

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05e8ab87ae1288e02bc17121e26208b3b139855ce7f702c467c1d493ce9a9f3f
MD5 1673b2265077411aa39f891b94ea4c80
BLAKE2b-256 edb1055c7590ec335cab8a63e520ec3802a58dc523b3075afba136a77f7f7590

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb97156398bdb40926976e6618ebb89c7b62bfd273ad27c7fdd7ec8b473c1fec
MD5 656989e754250b5ee4305c09591c7324
BLAKE2b-256 883498f294e9529eed3c864592e529d330d5c31c387e00da50dfe6001bd30959

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7602f4b9ee7902f2409d9345e145d67c574a6291c6bc37ed5303fb43ee5ba2d1
MD5 bbe8f06df027cba27d0a2159c64c627f
BLAKE2b-256 a906687c71f9d4304bd1e9cc392c71e95edec63b83a2e5878453c74495be73b3

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for gaspatchio-0.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a87ae32310b111a3d7b86141ff5ebb83c163570b935f54fcd1613885d0def8c1
MD5 459323d40a1580a341f74f3ee55034d8
BLAKE2b-256 fb9556aab85ef756f51b463762f5f6ac31716778eb959806038fa56c76de6860

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 078b60e86386b86dfa452f19bdab8cb97e80d820bb1f911b9bfb18de25fd3a60
MD5 98069065ebf6e622ba1be3915127bf55
BLAKE2b-256 95bc593de041334d4f38ba16681d556f03c5f14c66a2b72e667074e1951e578b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ea30d52bed22198307452957e7282bb333c94c4a25f0e3dc1f21603bf76292b2
MD5 eca7757ebb11b27464e43c4ecb8d0114
BLAKE2b-256 2a60609a157129d2c1ece608ef718dc5f3d10df49a34051da1f1efd30bf868cb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 da29995342b6d1d312c9a9ed3079bbb698c4e2e9d4a5d31c6181b344e400e9b8
MD5 8df1c7e464dbe438b457ab5019266c9e
BLAKE2b-256 66ef39aa6824d27fbb546779cd1b4fbbb79420eed3846a621798ba8750a83f0e

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for gaspatchio-0.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1e2c58e23ae0fdf66791b60c1b85e41d39fd4032811fe13214bcc5f9fad697ac
MD5 c6fe2a831a49288cbbc7c313c5d70a2f
BLAKE2b-256 833fcea9e345952f5db58afd8611d57466df5deed93025b931fc66c01996942a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9e5b008b659a17c45c533cf97fd8abf05050c807a9776cbf98d5da80f60eebb2
MD5 9835b2dd01680706e97e9681e785c54c
BLAKE2b-256 b9af55b82883607997e17a8cfcf0856425b73cf97484bf2e913e881114cf3a12

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f88da8d6b10343fa96f167d8528629a08bbe45334a9d6fe36f42b93f9876f209
MD5 8046c617f5b5377827afa270e87cf446
BLAKE2b-256 1b8a01f9ac1e6a3f8278011e34fe3b35d4dfbfaf19944d922edfddd920ae0213

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 948ae2e0d02309cff70ad350bb03f9c05f38ec1761d522884a020e676d27df9f
MD5 2637c9b37a601864f2b37f356f192540
BLAKE2b-256 8b448b07c7054ca5ea71550ffb7cf6f1f4fc9006c4c27dabfed82617b84e95f6

See more details on using hashes here.

Provenance

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page