Skip to main content

Open, auditable clinical calculators - Python bindings for the clincalc Rust engine

Project description

clincalc (Python)

Python bindings for the clincalc Rust engine - open, auditable clinical calculators.

Install

pip install clincalc

With pandas support for batch computation:

pip install clincalc[pandas]

Quick start

import clincalc

# Discover available calculators
print([c["name"] for c in clincalc.list_calculators()])

# Calculate BMI
result = clincalc.calculate("bmi", {"weight_kg": 70, "height_cm": 175})
print(result["result"])           # 22.857142857...
print(result["interpretation"])   # "normal"

# Inspect a calculator's input schema
print(clincalc.get_schema("egfr"))

# Get a fillable input template
print(clincalc.get_template("egfr"))

Pandas batch helper

import pandas as pd
import clincalc

patients = pd.DataFrame({
    "weight_kg": [70, 90],
    "height_cm": [175, 180],
})
results = clincalc.batch("bmi", patients)
print(results[["result", "interpretation"]])

When the DataFrame column names differ from the calculator field names, pass a mapping:

patients = pd.DataFrame({"weight": [70], "height": [175]})
results = clincalc.batch(
    "bmi",
    patients,
    input_columns={"weight_kg": "weight", "height_cm": "height"},
)

License

AGPL-3.0-or-later.

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

clincalc-0.2.2.tar.gz (511.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

clincalc-0.2.2-cp39-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

clincalc-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

clincalc-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

clincalc-0.2.2-cp39-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

clincalc-0.2.2-cp39-abi3-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file clincalc-0.2.2.tar.gz.

File metadata

  • Download URL: clincalc-0.2.2.tar.gz
  • Upload date:
  • Size: 511.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for clincalc-0.2.2.tar.gz
Algorithm Hash digest
SHA256 fbd3ca626f8bf8b8c3258dad08bf92cfb108491b0476905a282f8e53a538c695
MD5 8a380287ae783b7d084af4c07b7cd964
BLAKE2b-256 76f302f419536b6b773ccd8ee8ab29449691100fdd2fdd06ee7ae591650bb24d

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.2.2.tar.gz:

Publisher: publish-python.yml on pacharanero/clincalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clincalc-0.2.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: clincalc-0.2.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for clincalc-0.2.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 011549ecbb4db8071fb9aaa6da1bec29f275e54119f8ea228e520d7181360f90
MD5 33f7607b9d4e430a791cae208763c6cb
BLAKE2b-256 54bbdc20acfce0d31d3d6bf8af1a4879e2948d80c5b566228041d22d4c9b8431

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.2.2-cp39-abi3-win_amd64.whl:

Publisher: publish-python.yml on pacharanero/clincalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clincalc-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for clincalc-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 70627e8d0524350367697a60fbfdff431c2091ef14d8307d923d5681f68d95aa
MD5 46b043733f1cac2cfe606d9538cd54f1
BLAKE2b-256 0d86d6f38bbc1da0566150a888661c6f532fb1ed197082d12d78f0344adc0bce

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.2.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-python.yml on pacharanero/clincalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clincalc-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for clincalc-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8c868f625e24941fc9e04d53eefa13948f06105b838ed7db98377f554af62323
MD5 f3b49468ca291dd327b231963187a530
BLAKE2b-256 52ff8839ccc7f369c6f5f828d263eab5c4e811c9add7574e278851be919dc5d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.2.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-python.yml on pacharanero/clincalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clincalc-0.2.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for clincalc-0.2.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 630f8c85a0f74bdcf0c8244ce32e816b097915ff48d3d5f9fc24ba9e11b337a1
MD5 f8188fead2efe75e22596be85e1ea3af
BLAKE2b-256 24d6aeb7a68ca2715f56b9b4ee852e50076865b99ffa032de4136383ad06b951

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.2.2-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish-python.yml on pacharanero/clincalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clincalc-0.2.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for clincalc-0.2.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 22447899fcbf123e28fc7905c59f740709195a05660ddb362a125c6bd8d03cd4
MD5 c5d4851aef9c31e1ee00646f06cc909f
BLAKE2b-256 9e07283fa417fa367f0da665a9baa7c81df26940b3666150152e0bd233f61e20

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.2.2-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish-python.yml on pacharanero/clincalc

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