Skip to main content

pyAKI allows calculation of Acute Kidney Injury from urine output and creatinine based on KDIGO criteria.

Project description

Coverage Status

pyAKI

Python package to detect AKI within time series data.

The goal of this package is to establish well tested, comprehensive functions for the detection of Acute Kidney Injury (AKI) in time series data, according to the Kidney Disease Improving Global Outcomes (KDIGO) Criteria, established in 2012 [^kdigo].

For more information, see the documentation.

Installation

You can install the pyAKI package from PyPI or from source.

Frm PyPI:

pip install pyAKI

From source:

pip install git+https://github.com/aidh-ms/pyAKI

Usage

import pandas as pd

from pyaki.probes import Dataset, DatasetType
from pyaki.kdigo import Analyser

data = [
    Dataset(DatasetType.URINEOUTPUT, pd.DataFrame()),
    Dataset(DatasetType.CREATININE, pd.DataFrame()),
    Dataset(DatasetType.DEMOGRAPHICS, pd.DataFrame()),
    Dataset(DatasetType.RRT, pd.DataFrame()),
]

analyser = Analyser(data)
results: pd.Dataframe =  analyser.process_stays()

Contributing

Getting Started

[!NOTE] Use the included dev container to automatically install all the necessary dev tools and dependencies. To use this you first need to install docker under Linux or WSL2 under windows.

  1. Clone the repository:

    git clone git+https://github.com/aidh-ms/pyAKI
    cd pyAKI
    
  2. Open the project in Visual Studio Code:

    code .
    
  3. Reopen in Container:

    • Press F1 to open the command palette.
    • Type Remote-Containers: Reopen in Container and select it.
    • VS Code will build the Docker container defined in the .devcontainer folder and open the project inside the container.

Tests

To test your contribution, you can use the testing tap in the VS code or utilise the following command to run the unit tests for this project:

poetry run pytest .

Acknowledgement

We encourage all users to use pyAKI in their scientific work. Doing so, please use the following citation. Our paper can be found on PLOS One.

@article{10.1371/journal.pone.0315325,
    doi = {10.1371/journal.pone.0315325},
    author = {Porschen, Christian AND Ernsting, Jan AND Brauckmann, Paul AND Weiss, Raphael AND Würdemann, Till AND Booke, Hendrik AND Amini, Wida AND Maidowski, Ludwig AND Risse, Benjamin AND Hahn, Tim AND von Groote, Thilo},
    journal = {PLOS ONE},
    publisher = {Public Library of Science},
    title = {pyAKI—An open source solution to automated acute kidney injury classification},
    year = {2025},
    month = {01},
    volume = {20},
    url = {https://doi.org/10.1371/journal.pone.0315325},
    pages = {1-14},
    abstract = {Objective Acute kidney injury (AKI) is a frequent complication in critically ill patients, affecting up to 50% of patients in the intensive care units. The lack of standardized and open-source tools for applying the Kidney Disease Improving Global Outcomes (KDIGO) criteria to time series, requires researchers to implement classification algorithms of their own which is resource intensive and might impact study quality by introducing different interpretations of edge cases. This project introduces pyAKI, an open-source pipeline addressing this gap by providing a comprehensive solution for consistent KDIGO criteria implementation.   Materials and methods The pyAKI pipeline was developed and validated using a subset of the Medical Information Mart for Intensive Care (MIMIC)-IV database, a commonly used database in critical care research. We constructed a standardized data model in order to ensure reproducibility. PyAKI implements the Kidney Disease: Improving Global Outcomes (KDIGO) guideline on AKI diagnosis. After implementation of the diagnostic algorithm, using both serum creatinine and urinary output data, pyAKI was tested on a subset of patients and diagnostic accuracy was compared in a comparative analysis against annotations by physicians.   Results Validation against expert annotations demonstrated pyAKI’s robust performance in implementing KDIGO criteria. Comparative analysis revealed its ability to surpass the quality of human labels with an accuracy of 1.0 in all categories.   Discussion The pyAKI pipeline is the first open-source solution for implementing KDIGO criteria in time series data. It provides a standardized data model and a comprehensive solution for consistent AKI classification in research applications for clinicians and data scientists working with AKI data. The pipeline’s high accuracy make it a valuable tool for clinical research and decision support systems.   Conclusion This work introduces pyAKI as an open-source solution for implementing the KDIGO criteria for AKI diagnosis using time series data with high accuracy and performance.},
    number = {1},

}

[^kdigo]: Improving Global Outcomes (KDIGO) Acute Kidney Injury Work Group. KDIGO Clinical Practice Guideline for Acute Kidney Injury. Kidney inter., Suppl. 2012; 2: 1–138.

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

pyaki-1.0.4.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

pyaki-1.0.4-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file pyaki-1.0.4.tar.gz.

File metadata

  • Download URL: pyaki-1.0.4.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Linux/6.8.0-1020-azure

File hashes

Hashes for pyaki-1.0.4.tar.gz
Algorithm Hash digest
SHA256 1a45fc80af8e335073e0245497347ab7b2ca3f8f165915c20a3207d29a9c6de1
MD5 422de42f8c3218e2444c984da29a886f
BLAKE2b-256 b07f32e0580517a2abef0b45b04ff7aa5d1ad56d58141a8c6bd02de3823e84ea

See more details on using hashes here.

File details

Details for the file pyaki-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyaki-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Linux/6.8.0-1020-azure

File hashes

Hashes for pyaki-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7137daa5962d96baddf22859859c7e17812e47f256f184a54768fc454aef51f5
MD5 5c70e633d6f41bfd42a4e8dc9087c446
BLAKE2b-256 5810fc0d2593f1e3231d0d24b6817b51e28457f92a9821efe44d6daa4d710829

See more details on using hashes here.

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