Skip to main content

clifpy - Python Client for CLIF

CLIF Logo

Transform critical care data into actionable insights

PyPI version Python Versions License Documentation uv

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

  1. Install uv:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Clone and install:

    git clone https://github.com/Common-Longitudinal-ICU-data-Format/CLIFpy.git
    cd CLIFpy
    uv sync
    
  3. 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)

Source distribution for clifpy 2.1.0
File Size Uploaded
clifpy-2.1.0.tar.gz 2.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for clifpy 2.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page