meds_reader: A Pythonic interface for MEDS datasets
meds_reader is a fast and easy-to-use library for reading and processing subject data stored in MEDS (Medical Event Data Standard) format using a Python-native API.
Inspired by HuggingFace Datasets, meds_reader transforms MEDS datasets into collections of Python objects, that can then be processed using normal Python functions.
Example
$ meds_reader_convert mimic_meds mimic_meds_reader --num_threads 4
import meds_reader
database = meds_reader.SubjectDatabase("mimic_meds_reader")
for subject_id in database:
subject = database[subject_id]
print(subject.subject_id)
for event in subject.events:
print(event.time, event.code)
for property_name, property_value in event:
print(property_name, property_value)
To learn more, see our full documentation.
Installation
meds_reader can be installed using pip.
pip install meds_reader
Interactive Demo
An interactive demo can be found at Google Colab.