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

Uploaded CPython 3.14Windows x86-64

gaspatchio-0.5.2-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.2-cp314-cp314-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

gaspatchio-0.5.2-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.2-cp313-cp313-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

gaspatchio-0.5.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

File metadata

  • Download URL: gaspatchio-0.5.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f6474eefd7bd8f78fc596e48f76361dcde6b051190f3bfd68de87d31c6ff6d2d
MD5 bf197d59de3c935847a01bac9fe4235d
BLAKE2b-256 2a9bb6ad6d13a244070d9bc294edf05da6552603defcdb3df2bf952e48212b9e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba7f1ba6adac06e6ac39e65df51bc35cbe359a8d55faa05552374e0f60dc2b40
MD5 bb3bb5683f0b2661e26beef2f4406663
BLAKE2b-256 6415d3910db365b4ba2053e8e8cf5991d8af425f2b20e668e2f98514599b2ebd

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for gaspatchio-0.5.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 492ea6cabe88b054d5296592997b49aec36a74e8b7c9c8dc34358b7a823f14e1
MD5 c0efc987a226413c30ad6c2cf3aefa9d
BLAKE2b-256 3fd559e83da3e3db833fd33045d8e7b5707b3ba0db4e8d629ad89f41651657d1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 324ef95e24b111493c0e46bd22b0046d8adf2eef41a6ae618b7b6e9ae40ac2d5
MD5 877e2efda37d9e711793da1f467dc103
BLAKE2b-256 5740290a41e3e7eb4fa6e336b49d95f9fbef90e34790a7f317ed27c1f1b6f038

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a09e78164482434682e942bb65276823407f7ba6bd70f547a243e2a97b6ba92
MD5 24a7be83c24cd7ce7e74d8237ef96cee
BLAKE2b-256 aa1b7da6fcc956115cb9f5c083465adf1bf731efd89875b9b1a375e58e612213

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f9220acbc67961e3694399a7e1fd3b9f5cbdd408877607f013c30dbd5cd4d90d
MD5 251f214c8115ceb4f7f2be5c46b501f6
BLAKE2b-256 e19d01cf69fcaf88afaf0618e37cac4a01871bd70b1064abfe10f4282f76f79a

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for gaspatchio-0.5.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ad51fa47f89293d039c98cf1ea7714e009f860c26e9d625935f1d6d774c02169
MD5 a260c048f617337858ad443504142ab5
BLAKE2b-256 2197243752ea6dfa0f594d2a3d9c836a9a8472c0e3bb4c1da90d08d23357184f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33a41409dbfd257f9ecc5ebd8f54328febfdf6e64562867f5da4777525661e55
MD5 f438f77c2f4219719d51beb08c097f45
BLAKE2b-256 019af47c06055bfc511e4e85a54b5f325c7bfea79e7a5322233794dfa2d9d078

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 24f87c29df6d5be12659ed5d14f84649fef3ea33e4d4a5d1aed23f362c04797d
MD5 66fcb97e6aefa491dda43a2ed6fe4735
BLAKE2b-256 52865021a9da063f777d109d199e4a11f7003c5785f6d180ad8f55b99148ddf8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 12e7b855525daeb557074274ef6e03dc8c93681ab0f288b1c45786d7ef8a4c4c
MD5 d168eee40bef3db1e23d12389caf66b1
BLAKE2b-256 4f43e5463dafd6f9223dcc8c1b7c599d4dddbd3109884f32837ef014678e9de3

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for gaspatchio-0.5.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7364c620b89fbf961a133661327e54b7e941d5a07e6e993080cd3dadead2b905
MD5 22e7adbdc4500548b98cd1cbe2b03a6c
BLAKE2b-256 c6147cd1499d13a55baf42144f964cd2c3b36e8dd0c7c8c36ecf5eb126ad9cc7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2aa924f76f31ff864338e3b6730b5c7f3d4e61b511431e95f3a5bf554b762a1f
MD5 7962f4e5da399f0edbf04b6c4d41bacb
BLAKE2b-256 5222d3e9c64d04191492175801e01c6faa5cf9942bded443cf419c3e51f806dd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87ca09e4ed1c3d5e2b587afda5970d0c96912a8e94b783461129eebef37a0bfb
MD5 ce199db1a45c75a035369a0208ab12d2
BLAKE2b-256 a3dd56efe9823b462727bc090dc1e250bb95369e8873df730fd0351352d5cdd4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e6d42d752a1569346c00ebad51970513c62022b16c64a51d283d714e34d6ab99
MD5 68906de4a5750592783669670960835c
BLAKE2b-256 dbec31bdd20e26a3ce39d857bc7d273e1920c6bc302a6769ea35e2cd29a688aa

See more details on using hashes here.

Provenance

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

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