Skip to main content

clincalc (Python)

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

Install

clincalc supports CPython 3.9 and later.

python -m pip install clincalc

With pandas support for batch computation:

python -m pip install "clincalc[pandas]"

Quick start

import clincalc

# Calculate BMI
result = clincalc.calculate("bmi", {"weight_kg": 70, "height_cm": 175})
assert result["result"] == 22.9
print(result["calculator"], result["result"])
# bmi 22.9

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

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

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

You can verify the installation directly from a terminal:

python -c "import clincalc; result = clincalc.calculate('bmi', {'weight_kg': 70, 'height_cm': 175}); print(result['result'])"

The command prints 22.9.

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

Original clincalc code is licensed under AGPL-3.0-or-later. The QRISK3 and QFracture modules retain ClinRisk's LGPL-3.0-or-later licence. Wheels and source distributions include the applicable licence texts and third-party notices.

The ASRS-v1.1 six-question scorer accepts coded adult responses covering the past six months from the authorised form, reports the classic dichotomous and alternative continuous methods separately, and carries the required attribution to New York University and the President and Fellows of Harvard College in every result. Current source and releases from 0.3.0 onward do not distribute questionnaire text or the separately licensed 18-question checklist; legacy 0.2.2 source artifacts did include the checklist and should not be used.

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.3.4.tar.gz (775.9 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.3.4-cp39-abi3-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.9+Windows x86-64

clincalc-0.3.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

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

clincalc-0.3.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

clincalc-0.3.4-cp39-abi3-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

clincalc-0.3.4-cp39-abi3-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for clincalc-0.3.4.tar.gz
Algorithm Hash digest
SHA256 66d2eb638776ab69e20109dca6563bfcadf50fecaae2998d9c1fb499f3abe542
MD5 7aad8e84e23e549001c367ad41fe56cc
BLAKE2b-256 7ad2876ff98699e3398ae24b1a25e7093126471e129fab1615e7d78b9fb9214b

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.3.4.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.3.4-cp39-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for clincalc-0.3.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e3d99206691a8277e33f88018d90b3e186059224c9f56f3ba4f12a0d62f33670
MD5 c75643e2fdce792295e737e24aab10c2
BLAKE2b-256 3b8e6cc626b810baab0bdf94c9f4a53f3d79c12d00a008b99a1b274d108d6aa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.3.4-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.3.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for clincalc-0.3.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dbaefbdc3b305d58806adc23d09a70f446eb4aaab7ab71ead9a7ab770d63a18e
MD5 8586c5b0f41cbef1e7532786986e38f8
BLAKE2b-256 c650699067568575245d5c3e0355121fbab2b3c838f21e4bdcda0e99e2e12ef6

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.3.4-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.3.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for clincalc-0.3.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b4798972d21d25c44b6a4228bf4a335eacecfd586078ed04d90ac9168556acb1
MD5 59f342aec37e9b05d8d8255057a5e4a4
BLAKE2b-256 71c45d0b045bcf2df92cf83fbb31235afc8ece17683b4dccef2bb11bba72c7b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.3.4-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.3.4-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for clincalc-0.3.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9940462a06cbc17c2c7fdece5e992eea334ce0aac60bb34c23bd4dd6cc7c98b8
MD5 74c7d9d492bd93de20ac584d5619d698
BLAKE2b-256 9c76fa104e5602870b7702a6efbbf382e8983b398f2ef8391ca5fbb7fffbb742

See more details on using hashes here.

Provenance

The following attestation bundles were made for clincalc-0.3.4-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.3.4-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for clincalc-0.3.4-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8640e4971aae86b57e84a77ff253ccca0a05ab56b36bf28e947a193014d1aadc
MD5 17a271e6542aa62bf8ec5d0798e21171
BLAKE2b-256 b8f406885d7ded6c786dfcdf694b643d478f64809b7ffcdd629c74cb0d69ec57

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

This release

0.3.4 This release

6 files

0.2.2

6 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