Skip to main content

Python implementation of 2024 AHA PREVENT calculator

Project description

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)[^1][^2]. 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

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

pyprevent-0.1.5.tar.gz (3.0 MB view details)

Uploaded Source

Built Distributions

pyprevent-0.1.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-cp312-none-win_amd64.whl (203.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyprevent-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-cp312-cp312-macosx_11_0_arm64.whl (318.8 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyprevent-0.1.5-cp311-none-win_amd64.whl (205.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyprevent-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-cp311-cp311-macosx_11_0_arm64.whl (321.3 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyprevent-0.1.5-cp310-none-win_amd64.whl (205.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyprevent-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-cp310-cp310-macosx_11_0_arm64.whl (321.1 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyprevent-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-cp39-cp39-macosx_11_0_arm64.whl (321.2 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyprevent-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-cp38-cp38-macosx_11_0_arm64.whl (320.3 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyprevent-0.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pyprevent-0.1.5-cp37-cp37m-macosx_11_0_arm64.whl (320.4 kB view details)

Uploaded CPython 3.7m macOS 11.0+ ARM64

File details

Details for the file pyprevent-0.1.5.tar.gz.

File metadata

  • Download URL: pyprevent-0.1.5.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for pyprevent-0.1.5.tar.gz
Algorithm Hash digest
SHA256 7ef6f8eaa890d35a7584b8525fc29b40bd55f50d49dd51a0055ed88424ebb761
MD5 5cb9f07ac901c0b1437adb3af4bf8a60
BLAKE2b-256 39eb5d1f99443cb46a8fb47171b8789c3bc388cc22c08b9c6490904ea487a916

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 878f9de5b32345d01a529ae9224d1cac7ac4e82e7078ad791fc6a5139a1f75cb
MD5 f5a622959ee153cada5602af9b789297
BLAKE2b-256 001009386874f77228ad2d8845e653c0894bbbfdbf630130402aa9866c289878

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d802c2eae683539514652a47765db20672ee6a4c0f084754740f990e1bab0d0b
MD5 c8141cff934c0dac4f85ba65882e3e17
BLAKE2b-256 80fd21427222618bdba7a8624d4c7811510cd749809afe9be3469ae433462761

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 59ce9a8b16a815e65f3604f695692bc96f29a50548f26e52d0342a2443b95b2d
MD5 711694c22e60c12c9a7c07e53b23db14
BLAKE2b-256 732a72361fabff67fe3f20ba02ee472905815a9e574935649042c970f4711e2f

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d0fa124bf0e5960989710212aa670276e5dd9745ebc38e7e86a90e56ef5fbc2
MD5 e06f8f9bfb09c4c28b7040f704337477
BLAKE2b-256 b4cf1b145875457e82c3b8746f5dfeba546c35307755dc630a8c1ed3d190e710

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp312-none-win_amd64.whl.

File metadata

  • Download URL: pyprevent-0.1.5-cp312-none-win_amd64.whl
  • Upload date:
  • Size: 203.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyprevent-0.1.5-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 7091832f8f715112a192aeeddff315865168a8291d4fc9e3210483d3c6a03c0c
MD5 2b8b399daacc5dccc4891c8658a1587c
BLAKE2b-256 d9ce75556e93ae97868469d6be5510b9450a7a5d6aea1319f63e7efdd24cb700

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c8f6e9ced52cf592ceefe8463fce5fef5929daa149b3e269ccb9065f86bcba3
MD5 d768ee8bc991a32914f79f8eaea6c250
BLAKE2b-256 73b12c1bf701c45a88773a5b255952604e866c98e9c644e34aa630324ade4b63

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a1e5534ff9f865962cb1a4ea0f8dfc6e0a4b1b44d440ca194dcd37affb107556
MD5 4d5b87e2a1602bbe7383a2ff407ef632
BLAKE2b-256 9310d4323065444b8aad74f743d575f497b9e99030ef7be906fda8909b17e31a

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp311-none-win_amd64.whl.

File metadata

  • Download URL: pyprevent-0.1.5-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 205.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for pyprevent-0.1.5-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 112642050e4bb53986bd863c613f576f7dac09d9631c00387ffe18aa80e11571
MD5 6d7a8b0122711d45408830909755c2da
BLAKE2b-256 8afd713b5a5dd78581179b1c74d0f266f950275e7f870c610e617a95003c2f31

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 794f7634e519a0f2cbec1c05dee6280905b8191e0dc7b4f2b8b68fc120b3a156
MD5 f8fb7adba6acb532674a92f29789a02a
BLAKE2b-256 5f97a30fd9108227f211c5be1f7f871baa866bd34c950e59088bfd042a734af3

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb99041555b97d0c4dbb1cbb79126079a9d21dea2cabe4327c13e98fc69f6a87
MD5 6133e578e053687af20a699bf49e77fe
BLAKE2b-256 1afad811108fd50ce92c718b55b0df0622d290e874249499af93833596cc3582

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp310-none-win_amd64.whl.

File metadata

  • Download URL: pyprevent-0.1.5-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 205.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for pyprevent-0.1.5-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 4caf05f1b2a81433835a0ea081603c8200d4849b7ef4d2860e5ab6de860ef7a9
MD5 acc5c1311036119169f52ddd8e60ac4d
BLAKE2b-256 23728d3db63446c50cb2af90a6e1ea626be5418b2bb4a8499ed505aad16feeaf

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 838aaae94c6d8e8891d6ea245cc5397f34a893913d923485e9fb843b7a58095b
MD5 2ba88a8c23e5b14a1c0de94f02a86152
BLAKE2b-256 a198a4153329c1c69f6ea5c804c8d583f83cfab5991c72e7948e14adf0516e0c

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e12c9a49498f6f0f2bf1698164d57c69c66402948518a3c3d24cbdd64d87b05f
MD5 c1caf357bd33f2e9fdaa4b5e20dee0b3
BLAKE2b-256 bfb95233be259643f403059a1667a964fe0ddbeb2235b364884043af56ccedcf

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f0992c7730abf367c3ac5745606ae14890511e564879bdd0044b9137d5b77a66
MD5 64267990d1eeaa6965e85da7ca9f4d08
BLAKE2b-256 fed50aad8f1ebc4111163da225dcbe2ef6ff5729f5a0c69527e1bf6a9539b20c

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a55acf58114d2916c9c3294fe1ba78284623dd03037286c6df7d55f129feea19
MD5 d1a86bdb32d1ae41b597f0d4652f2a96
BLAKE2b-256 6abddb754c128ed5b05bf034edeb128b01dd24d021fa660a8bd27467571c99e3

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b14e1a18dcf5965e5aeef63bea5d91628b11618e41e32d639aeef6ea7159fb1
MD5 e664a74a39b0f2c365b4b3455d711c63
BLAKE2b-256 95e26a0f7bbcfabef0367970b02fd44ef490b202d39ac277d547623fe6cb57a7

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b7ee3230719fe325935405c0530595ef9439183b90cb8d58ae8f3901041f23f4
MD5 5596d862b325f19d80a6caccbe60326f
BLAKE2b-256 ac9ff4576804b1d2845ec52a1ac08a0b2c3b735b77543776eca3e612a7551ee8

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 781efa9eabafe27aae6a92c6bcfa8cd17849bd127970b181fd3daf1a147f77a0
MD5 a4de1d0a8f049d4df911b8dbfa7c3fe3
BLAKE2b-256 5eee8d99374be8205d68d06d5b5ab01e0d5e5223740f365b9351123f9dd81ff3

See more details on using hashes here.

File details

Details for the file pyprevent-0.1.5-cp37-cp37m-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyprevent-0.1.5-cp37-cp37m-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8c42e514848010ef0056d52f4b8280f6ac27bcf92bdbabcaec3cb6a50d4184b
MD5 5708f5cfc2f4cb7c94243786c2fc7127
BLAKE2b-256 0a3c3c5533e4718ddfc3b0aee7aae8d8dbd6cf90ede1bae631a398f74ebff12f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page