Skip to main content

ehrdata

Tests Documentation

EHRData overview: an X data array with obs, var, and tem annotations, alongside layers, obsm, varm, obsp, varp, and uns.

EHRData is a data framework that comprises a FAIR storage format and a collection of Python libraries for performant access, alignment, and processing of uni- and multi-modal electronic health record datasets. This repository contains the core ehrdata library, which has the EHRData class at its heart. See the ehrapy package for an analysis package that uses ehrdata to enable the analysis of electronic health record datasetes.

Getting started

EHRData extends AnnData to represent data of n observations × d variables × t time points — a natural fit for the time-resolved measurements found in electronic health records.

import ehrdata as ed

# Load the PhysioNet 2019 sepsis-prediction challenge dataset
# (downloaded and cached on first use)
edata = ed.dt.physionet2019()
edata
EHRData object with n_obs × n_vars × n_t = 40336 × 35 × 48
    obs: 'Age', 'Gender', 'Unit1', 'Unit2', 'HospAdmTime', 'training_Set'
    var: 'Parameter'
    tem: '0', '1', '2', ..., '45', '46', '47'
    shape of .X: (40336, 35, 48)

The 35 clinical parameters are stored over 48 hourly time steps in a single three-dimensional array, with patient- and variable-level metadata aligned alongside. You can slice across all three axes at once — for example, the 48-hour trajectory of the sepsis label for one patient:

edata[edata.obs.index == "p020378", edata.var_names == "SepsisLabel"].X

For more, please refer to the documentation, in particular the API documentation.

Disclaimer

ehrdata is under heavy construction, and its API not stable. If you find it potentially interesting for your work, reach out to us via the scverse zulip platform! We can help you using it and will be able to stabilize things you need.

If you have inputs on features, please do not hesitate to open an issue on our issue tracker!

Installation

You need to have Python 3.12 or newer installed on your system. If you don't have Python installed, we recommend installing Mambaforge.

There are several alternative options to install ehrdata:

  1. Install the latest release of ehrdata from PyPI:
pip install ehrdata
  1. Install the latest development version:
pip install git+https://github.com/theislab/ehrdata.git@main

Release notes

See the changelog.

Contact

For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.

Citation

t.b.a

Metadata

Release files for ehrdata 0.6.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 ehrdata 0.6.0
File Size Uploaded Provenance Actions
ehrdata-0.6.0.tar.gz 4.4 MB With provenance Details for ehrdata-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ehrdata 0.6.0
File Interpreter ABI Platform Actions
ehrdata-0.6.0-py3-none-any.whl Python 3 none any Details for ehrdata-0.6.0-py3-none-any.whl

Total release size: 4.5 MB

Release files / ehrdata-0.6.0.tar.gz

Download URL ehrdata-0.6.0.tar.gz
Size 4.4 MB
Tags Source
SHA-256 checksum
How to use checksums
691deea08fd44ca49100e1112db5e827eddb048e7fe4bdf623eef409f7ccab3c
BLAKE2b-256 checksum
How to use checksums
07e0f2a65865290cda0eef0b1cdf949da417ae8cfbfe82b1ca580a145d4c21b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / ehrdata-0.6.0-py3-none-any.whl

Download URL ehrdata-0.6.0-py3-none-any.whl
Size 147.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b538e72ff3e73d0ebf0a0873ab28c4fd21e407e627e2dbd0fa58ef2f67ae92c9
BLAKE2b-256 checksum
How to use checksums
bb8fb2ed814d6a8e1e2b44e52f616d42312575322f7cd79a5e47ba3fa2b45209
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for ehrdata 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ehrdata-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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