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
- ✅ Data Quality Assessment Framework: Comprehensive assessment of conformance, completeness, and plausibility across all CLIF 2.1 Beta tables
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 | |
| Data Quality Assessment | Dema Therese | Published | |
| Intubation Extubation | Vaishvik Chaudhari | In Progress |
Links & Resources
Metadata
Release files for clifpy 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| clifpy-2.1.0.tar.gz | 2.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clifpy-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.2 MB
Release files / clifpy-2.1.0.tar.gz
| Download URL | clifpy-2.1.0.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1af9b2d478a9b926c7d5c0ec48d38367cff84f0588bdfc9dfd31d7f4a10789f9
|
|
BLAKE2b-256 checksum How to use checksums |
bd83216a64264ff53ce5dcb25501d8c9742624cab0421c9529fb5dc95504e77d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / clifpy-2.1.0-py3-none-any.whl
| Download URL | clifpy-2.1.0-py3-none-any.whl |
|---|---|
| Size | 2.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd51f00a907f719b0147515500d3925a1f00dedc7d30d96c99e2ce3d6bd8bde1
|
|
BLAKE2b-256 checksum How to use checksums |
32d95e7e674e7deef6d576bd869887fb02f71f7a8ea7dce11c7bbe614fd3da4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|