Skip to main content

PyPREVENT :anatomical_heart:

2024 updates from AHA on ASCVD (Atherosclerotic and Cardiovascular Disease), CVD (cardiovascular disease) and Heart Failure (HF)


Python- 3.7 --> 3.12 Rust

Introduction

The PyPREVENT Equations package offers 2024 updates from the American Heart Association (AHA) on Atherosclerotic and Cardiovascular Disease (ASCVD), Cardiovascular Disease (CVD), and Heart Failure (HF)12. It's a mixed Rust and Python module, leveraging the speed of Rust for equation implementation and the flexibility of Python for ease of use.

Installation

Requirements:

  • Python 3.7 to 3.12 on a Silicon Mac / Linux system (more compatibility coming soon)

To install the package, pip install using:

pip install pyprevent

TL;DR

import pyprevent

pyprevent.calculate_30_yr_ascvd_risk(
    sex="MALE",
    age=40,
    total_cholesterol=200,
    hdl_cholesterol=50,
    systolic_bp=120,
    has_diabetes=False,
    current_smoker=False,
    bmi=25,
    egfr=70,
    on_htn_meds=False,
    on_cholesterol_meds=False,
)

Examples

A longer, and more thorough example is located here.

Implementation Status

Formula Status
10 yr ASCVD (individual) :white_check_mark:
10 yr ASCVD (batch) :white_check_mark:
30 yr ASCVD (individual) :white_check_mark:
30 yr ASCVD (batch) :white_check_mark:
10 yr Heart Failure (individual) :white_check_mark:
10 yr Heart Failure (batch) :white_check_mark:
30 yr Heart Failure (individual) :white_check_mark:
30 yr Heart Failure (batch) :white_check_mark:
10 yr CVD (individual) :white_check_mark:
10 yr CVD (batch) :white_check_mark:
30 yr CVD (individual) :white_check_mark:
30 yr CVD (batch) :white_check_mark:

Program Structure

This is a mixed Rust and Python module.

The rust source code is used to implement the equations. This is a lower level language that requires compilation prior to being run -- and thus is many times faster than pure python.

The rust source code is located in the /src directory. The individual functions are written in their respective files, and registered to the rust_aha_formulas python module within the lib.rs file.

The python source is located in the /pyprevent directory.

Unit tests are implemented in the /tests directory using slash.

  1. Khan SS, Matsushita K, Sang Y, et al. Development and Validation of the American Heart Association Predicting Risk of Cardiovascular Disease EVENTs (PREVENTTM) Equations. Circulation 2023. DOI: 10.1161/CIRCULATIONAHA.123.067626 ↩

  2. Khan SS, Coresh J, Pencina MJ, et al. Novel Prediction Equations for Absolute Risk Assessment of Total Cardiovascular Disease Incorporating Cardiovascular-Kidney-Metabolic Health: A Scientific Statement From the American Heart Association. Circulation 2023;148(24):1982-2004. DOI: 10.1161/CIR.0000000000001191 ↩

Metadata

Release files for pyprevent 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pyprevent 0.1.6
File
pyprevent-0.1.6-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
pyprevent-0.1.6-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details
pyprevent-0.1.6-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pyprevent-0.1.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
pyprevent-0.1.6-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pyprevent-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
pyprevent-0.1.6-cp311-none-win_amd64.whl CPython 3.11 none Windows x86-64 Details
pyprevent-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
pyprevent-0.1.6-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details
pyprevent-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pyprevent-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details

Total release size: 3.3 MB

Release files / pyprevent-0.1.6-cp314-cp314-win_amd64.whl

Download URL pyprevent-0.1.6-cp314-cp314-win_amd64.whl
Size 211.7 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
cf645ec263e03687857d0c3941810bffb104993a7e32dc853df623436c51418c
BLAKE2b-256 checksum
How to use checksums
98dc8b4a49c13c6dbf34bb8577382128495248e7ae8d353c6399af84d5086beb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / pyprevent-0.1.6-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyprevent-0.1.6-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 381.5 kB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f53343e5ea89faa5a639f89f19c6b67b2fc3c39a324d58d228cfc07f96c35360
BLAKE2b-256 checksum
How to use checksums
3b92640e7dae59adb306812f0a4b6bae7c9d597574e47b9f3a8bcf9ac4b6c4e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyprevent-0.1.6-cp313-cp313-win_amd64.whl

Download URL pyprevent-0.1.6-cp313-cp313-win_amd64.whl
Size 211.7 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
6026c9d48afd2621db5a1802a8612899a4ffee86fe8a6ff125bb5843a80bda6a
BLAKE2b-256 checksum
How to use checksums
76e81ffd0f1d5b4a032c17971035e3f3ef3b6c5b077529781ad539b3f36eb28b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / pyprevent-0.1.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyprevent-0.1.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 381.5 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
c0fb84aecd9bd9b0c99368bb28961a57922900c5763a51f1dfc12bbbcc8e307f
BLAKE2b-256 checksum
How to use checksums
1d24e1c1bc1dc19aa60bf8fda2d09e2188772445b7b116189891c70d85022d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyprevent-0.1.6-cp312-cp312-win_amd64.whl

Download URL pyprevent-0.1.6-cp312-cp312-win_amd64.whl
Size 212.1 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
122f6d3e853fa5470927145e764ee19fec4286216a7a51d35b7b3d7d8f9384c5
BLAKE2b-256 checksum
How to use checksums
3d886b562ed4ba6adde10f8f604dfec81fc1e36c46dac1a52eb65b1f84c4035e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / pyprevent-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyprevent-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 381.5 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f5bf4b5deda16da31a6e397dae4e8be857e8e9984620ceaae6ca8138506c729c
BLAKE2b-256 checksum
How to use checksums
b5df15cd6cb61f3f3e550e4020078876c0e0307a24103dc1121f6f27065ddf11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyprevent-0.1.6-cp311-none-win_amd64.whl

Download URL pyprevent-0.1.6-cp311-none-win_amd64.whl
Size 197.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a7144ce58e1195d63104474e67c252db0430f73e350f8a4e2c9883a415292b84
BLAKE2b-256 checksum
How to use checksums
9349aefa15a68c0605f6314fad74757718f0d3eb060aed8c33357223846b10ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / pyprevent-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyprevent-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 380.2 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
69563650d06ddc421ecca2b44894bb9b29552d0c9c436bd34aa299d1dcf0d1d8
BLAKE2b-256 checksum
How to use checksums
efe1dc4192eb09ba591cb84635a821cfea172473f4ca0f7c636c53370fe38f12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyprevent-0.1.6-cp310-none-win_amd64.whl

Download URL pyprevent-0.1.6-cp310-none-win_amd64.whl
Size 197.4 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
9c077e774e2b28d0eb4ef626976145b277ef49d839b13f44b53adfa559579325
BLAKE2b-256 checksum
How to use checksums
6665a981b53b83ba0a93d54d0885652fae105d2660387750770e0e4c31f7d1e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / pyprevent-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyprevent-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 379.8 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6b4dced3819b039776253f0508148b23c3b763fe3e37e15b9d72e1a7e450e1fb
BLAKE2b-256 checksum
How to use checksums
d30b3576f8f163067f48aea9d279629543c4c09bc2767dce416e2c0e29bb50c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyprevent-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyprevent-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 380.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0f87c153116129e7c559faf9a1aaa476513a85e6f520421e8ba310ce02cfc881
BLAKE2b-256 checksum
How to use checksums
13f9672d0f9e3046fdd9a44f002fee3e05faa7b2e61ae9ac8cb5aa80e2becee8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.6 This release

11 release files

0.1.4

3 release files

0.1.3

17 release files

0.1.2

17 release files

0.1.1

2 release files

0.1.0

2 release 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