Transform critical care data into actionable insights
Documentation | Quick Start | CLIF Website
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.
- 📊 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
pip install clifpy
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
CLIFpy uses uv for fast, reliable dependency management.
-
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