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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

File metadata

  • Download URL: gaspatchio-0.5.1.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.1.tar.gz
Algorithm Hash digest
SHA256 eb969959d5b9fa5ea153c6ec12685550b98cee3176ffaf5288bde4d8a9c6d82b
MD5 332f9336a07cde6fbb4069eb85821bf6
BLAKE2b-256 5835263f03d27d17d4c62f87800e4575a4c3536f74d4efaee9f8b49f7b985eef

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26567c0aa12abf17859c32387c38f170eafb10664314a4537b46f91b6f152afd
MD5 fd06ba552d17b8eda0a3134fcc0c9a83
BLAKE2b-256 b7d1fa5bc3afbf6da99186c1f62e2a5445ff88c5c1b47c4e096a35efd37b156a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.5.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.5.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 808422c772a26ad9535bcb915f345cac56ac9f251835bf7801e83604059ccd12
MD5 f71c26eddb716e074fcdb7ac69c9d189
BLAKE2b-256 fa351eb91617c3aad61e49981bfe3dce0b6fda3173d7b13d894b376aa5fdcd68

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6695048baee3809a407e6345858410f0724c407ffe7fc584df5a9f2cdc46d084
MD5 6f643bd8bd0fbc4c0a0bf76e9f5f20bf
BLAKE2b-256 0aa0f380127e4aa2dc4ead4b84a14bc1bf1682292a1f7add73c333cfcf4ef203

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf45cd410f2a3789160974e92eeda8d2f35c7def47038d52d5ba16ae3bbcb631
MD5 642ca2c52f6f9f5d5c59062d4a960168
BLAKE2b-256 01aecf21ef48cdb6c36846cd444b84309b36463ee302d70769e0051a444b3eb8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 06aea85a0e070dd0337df354fb3388b895e32a446614c8a3ce5a101b5dc8c929
MD5 1786d0f1f9e98f190aececd9bb01bdef
BLAKE2b-256 fa61640376ca6ee3c0678cc3ef48022a873d40d1ec237a4339f3f613656fddbd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.5.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.5.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6b4c44ec2323325945749a9092287ff566632e772bc7230fbfc5a2ee3a911a78
MD5 a56b947e3ff402ee0a73a73a813927bf
BLAKE2b-256 da678ce23dce812753a987d3abae630ced501290900dcee476f38d1f4c7119e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0edf8b09f2502696d36738c4e262459c6652458ef68ebeb5d89afc4c8bdeaed0
MD5 7c280a8b93a12b3355c799bdd030087f
BLAKE2b-256 eb5387446ef0bfc94e63c214e4a65117394f63af219d6683e21c7c6a58bbc069

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1a8190f3be7fb5647cb644dde567c995ca88fe228765ad7c7e9925c90d5a689
MD5 75c182feaef8a066cad34aa2479007ba
BLAKE2b-256 d7fc8f4540467c737888fc7e7184c353af64fbd734ba62d2a86c0c86da214a83

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 10e4dfa513a218a8395226999d0db5678e95e1daed2a87c4ca4dfe4224cf12eb
MD5 c072e5c02db17a30bf4a85e8e0854dee
BLAKE2b-256 9395b7d46f55f7a4994bfdecd1b6dac24b7f3d69828b2e43c805df8b3188ec3b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.5.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.5.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 877f1be60aae34be176cbaf6a8401e82dc5de31395e8d2f66d58dc1b07edf0e6
MD5 e5edcd1150ba07e102a4de00ee2faa41
BLAKE2b-256 b8fbb880078ae37da9d1e9a6c64efb51f99f02f6d8c9edb05e0ae2c9fcc52956

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1025762580ff18d2389a1c9ba1ffc733cbdd693a27074e3cc9cdcc1ac209cabf
MD5 679f0a7d1233fd6d1bbf45a60fc0afef
BLAKE2b-256 f2bac2be1ffeb410ce451917cfe790fee56f233e507db2eadd8740930c28d2a3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04317b1ead39eb8e0950978f8a37a7f011734db6f556c3c279be01fc72b1455f
MD5 02856c3534af0175a4b0faaaf68085bc
BLAKE2b-256 156a16b295c4824e642762dac646c1b18f7ec8f6db656088c3f00c871c4f643b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0aaa4ea552513f8beeac49ab17ba2611b8f4917b3c1636aa0bfa9fced03a1a01
MD5 9e689667cb34fd3290a63342b397d9e4
BLAKE2b-256 ed8608d525675c28cb6f6f2eb2b437bb8f119cb37fba8711cba4cc144a275ace

See more details on using hashes here.

Provenance

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

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