A Python package for working with CLIF EHR data
Project description
clifpy - Python Client for CLIF
Transform critical care data into actionable insights
Documentation | Quick Start | CLIF Website
Standardized framework for critical care data analysis and research
CLIFpy is the official Python implementation for working with CLIF (Common Longitudinal ICU data Format) data. Transform heterogeneous ICU data into standardized, analysis-ready datasets with built-in validation, clinical calculations, and powerful data manipulation tools.
Key Features
- 📊 Comprehensive CLIF Support: Full implementation of all CLIF 2.0 tables with automatic schema validation
- 🏥 Clinical Calculations: Built-in SOFA scores, comorbidity indices, and other ICU-specific metrics
- 💊 Smart Unit Conversion: Automatically standardize medication dosages across different unit systems
- 🔗 Encounter Stitching: Link related ICU stays within configurable time windows
- ⚡ High Performance: Leverages DuckDB and Polars for efficient processing of large datasets
- 🌍 Timezone Aware: Proper timestamp handling across different healthcare systems
- 📈 Wide Format Support: Transform longitudinal data into hourly resolution for analysis
Installation
pip install clifpy
Quick Example
from clifpy import ClifOrchestrator
# Load and validate CLIF data
orchestrator = ClifOrchestrator(
data_directory='/path/to/clif/data',
timezone='US/Eastern'
)
# Validate all tables against CLIF schemas
orchestrator.validate_all()
# Access individual tables
vitals = orchestrator.vitals.df
labs = orchestrator.labs.df
# Advanced features
wide_df = orchestrator.create_wide_dataset() # Hourly resolution data
sofa_scores = orchestrator.compute_sofa_scores() # Calculate SOFA scores
Development
CLIFpy uses uv for fast, reliable dependency management.
Quick Setup
-
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
-
Clone and install:
git clone https://github.com/Common-Longitudinal-ICU-data-Format/CLIFpy.git cd CLIFpy uv sync
-
Run tests:
uv run pytest
Feature Contributors
| Feature | Coder | Clinician | Status |
|---|---|---|---|
| SOFA Score Computation | Kaveri Chhikara | Will Parker | Published |
| Respiratory Support Waterfall | Kaveri Chhikara | Nick Ingraham | Published |
| Presumed Infection and ASE | Vaishvik Chaudhari | Kevin Buell | Published |
| Cumulative Dose Calculation | Zewei (Whiskey) Liao | Future Feature | |
| Lab Conversion Units | Dema Therese | Cathy Gao | In Progress |
| CRRT Waterfall | Kaveri Chhikara | Shan Guleria, Jay Koyner | Future Feature |
| Medication Unit Conversion | Zewei (Whiskey) Liao | Published |
Links & Resources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clifpy-0.4.8.tar.gz.
File metadata
- Download URL: clifpy-0.4.8.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7085140a3a6635b786b4f29bf65fd0bf198592c37b666e9ee4e84cf2bc1eadad
|
|
| MD5 |
bb24110ac96c91c6973ea1632978c31c
|
|
| BLAKE2b-256 |
99235caa44b3f9e8d6ba3af5361918c2d08e8f71ae32a2bea90c9d94694dbd25
|
File details
Details for the file clifpy-0.4.8-py3-none-any.whl.
File metadata
- Download URL: clifpy-0.4.8-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf08284af5809cb3fd86e0e03971569dbf1079199ee5aa7c53fa079ddbb16781
|
|
| MD5 |
f982420d55d4ac2221e300c2cd3cb5e9
|
|
| BLAKE2b-256 |
7c6bb460da38930156841f56effaf92972ebd56a2512d16212e8944737483685
|