Skip to main content

A Python package for working with CLIF EHR data

Project description

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

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

clifpy-0.5.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

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

clifpy-0.5.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file clifpy-0.5.0.tar.gz.

File metadata

  • Download URL: clifpy-0.5.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for clifpy-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a3381dd529326b9d70949b662f8d29fe17636be0a3c0101357f6b59d89319fde
MD5 86a556cd2f2b4f7785a16894aed42552
BLAKE2b-256 b98e2da924b79890e6f0d11e6093120ed7a1b0f012559ad897f484fedacbd55f

See more details on using hashes here.

File details

Details for the file clifpy-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: clifpy-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for clifpy-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc908435bd8a09ad5db49760926e6bac14c2841bab748594f13f282bd8caa19a
MD5 e780aa3130697237a02133c5bb201e75
BLAKE2b-256 82f3d89d02a174c43fd55d7306bcd757ee4ae91094b78b9ef160a63d7fdca8f6

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