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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.14macOS 10.12+ x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

gaspatchio-0.5.3-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.3.tar.gz.

File metadata

  • Download URL: gaspatchio-0.5.3.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.3.tar.gz
Algorithm Hash digest
SHA256 7d97f48c6233cb3a0f30ca1e89fae040ecf2503df884ca142e97140ce5f41123
MD5 152ad3b4f865a4d7812c76754d75e5f6
BLAKE2b-256 20ade2841674a616b2ffd9607a08c8a7917108a1cdde3556c36e4776503e3918

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4581e71ff162fe597cfef10c7ad21e37d3f27d041bd15c1187fe95db11f008b9
MD5 47d8aa69fb973167fe19f4b283cef4a0
BLAKE2b-256 3cdf51a33eef792aba640fe54f2b71598fc9f0e8d46c720e13e6656ce22db7ec

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.5.3-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.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 be52a59c4352be957f33ebebb59dcecffb65a5a041c5e52236264797e8b147b2
MD5 e1e0043823952465f498b3771f55113d
BLAKE2b-256 a749f010db1c0decc6bc2caa00018547f74e0ffea33c9f1d8482e4077fc65d9c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eed60449bd839577b7dcf3121e87b1c5a8e21e41c58238524780c43bf333c172
MD5 9e38bd8e46ad2e582e3416bfbedc81b1
BLAKE2b-256 cace7e1c744dbd140bb8d386f96c39627f400b4753fd0a3aef480243d05b6569

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 473bed7955240ede3ae6711bd2aa5ca0f707a8f1422e9563e9376a5bbe15e864
MD5 671ab7a72612c0c364919fa4257553e1
BLAKE2b-256 5f8da77e5d6f91896dc94d60f71f84da3c508172e82e19c002a226570d0a66d6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 16d49c0dfac5a22ceb3fa58ddb53fcb7da64e82164140218fd5ed56865d6baa2
MD5 c47459b52d8194ff24aa7c196b4f6ac8
BLAKE2b-256 1bfb02b8ebb35bde38d3161570c311dbcfa40bcc0872f193576e03c71012a027

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.5.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8ee44b4190fede0db6022905257d591b95089c9cb21406385023ff551873373c
MD5 3d06b626061ef96462accbef4bc16bb2
BLAKE2b-256 5f217675f5d9493ed3495722d787e5517fef6467b113bf444610528bdf9bb81e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0fde280cabf6eb04afb1868554a4d9cd6adec605f28ea0f30c5884b2fbae2d11
MD5 47b573d7e94eb3a25c151287131fe3f2
BLAKE2b-256 f55c965110157b728149bdc3eb622f4c25a204a4b495537e245da5b7f74c5187

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fbd6116132474735c1c663506d060d487e1b6ba92f1ae90577cf972afd966eb3
MD5 3556648a4959198cbf76b28e119efd4e
BLAKE2b-256 39218b24dcea1e0daa0a7c2a1c369efc9a541fc19db8e98aa80bcc314f96c680

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b3454fc50e34947b173bdc595d224d1171ab24ff2907024f73dfbbbef4a82c72
MD5 21d78e86e7c41690a0d28bc08671fca7
BLAKE2b-256 556c2cbf29666e188072c70875c50ecdf92884d3a60d9411fc42f4a21d16a997

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gaspatchio-0.5.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b2b7bff59924b3e212626729412705a5379da7080277b92120b23ff617c0f405
MD5 5974eeadaf544ea89167967316b7f751
BLAKE2b-256 21104e46ab4d784379cf0b68136c7209839cdf350ad015f6e332a69c6a4c28d3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f94c0eccc037030fd8839020cfc82443f85c79dbf517128aa551832bfdd4960e
MD5 fd48621b8c1da320fefc59c09b6278b9
BLAKE2b-256 08083b48d08c0d21770f86ae020d7cf37d90061fd32e88566f56cd44bdd1c573

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f85be9b240d90256ce1ac0b8de42cf49baf29ea29b8ae5fa2356212915314eb4
MD5 80c19203b744721e9ced6437bf7995f0
BLAKE2b-256 301bd0af36bf8c5e69190a36b1966a295b24ae3d5388393c046f26bf9885dcdd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gaspatchio-0.5.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e1df8efccdb044725d812a77986bdf31716fa1c4488723b53b8bc0436850c627
MD5 a3dd835dea40f6f17d8fed77a2ba99fd
BLAKE2b-256 31c70ccf3c3fbc68dc22985ef4f4827b77f3067d3327c6f6f33a425817658712

See more details on using hashes here.

Provenance

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

0.7.1

14 files

0.7.0

14 files

0.6.0

14 files

This release

0.5.3 This release

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