A Pythonic interface for MEDS datasets
Project description
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
# First we need to convert to a database
# That requires running the following command in a terminal
$ meds_reader_convert mimic_meds mimic_meds_reader --num_threads 4
# Now we can use Python to interact with our data
import meds_reader
# We can now construct a database
database = meds_reader.SubjectDatabase("mimic_meds_reader")
# Databases are dict-like objects that store subject data
# We can iterate through all the subject ids in the database
for subject_id in database:
# We can retrieve subject data given a subject_id
subject = database[subject_id]
# Subject data can be manipulated with normal Python operations
print(subject.subject_id)
for event in subject.events:
print(event.time, event.code)
# We can also iterate through all properties in a generic manner
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for meds_reader-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd40107fddfaafaffcbff5c2697fa1af861d8c5c210355f2aab7a2e0d49e8a31 |
|
MD5 | d5ca73b714405c605015101e81cccd44 |
|
BLAKE2b-256 | 355ad448ae7d1660b35ad6a769643952095434b1d964221bede46f457567d8cd |
Close
Hashes for meds_reader-0.1.4-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91cce9d26c7c16cb0efe55792c82c61c83d0c171158dbdbdbded6dce760052dd |
|
MD5 | 3faec71f33180e8671803ade2a777323 |
|
BLAKE2b-256 | db9ee23d7247c01e2d684b089761f84859cdf859562e5ecefed2915e56dad12b |
Close
Hashes for meds_reader-0.1.4-cp39-cp39-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a388be0c723cf4c522d776213ac36cb39e98c79ffe4f5d2de7a489e3022e52f |
|
MD5 | d1adb56db45d84d939b681ec6a116d08 |
|
BLAKE2b-256 | 72499bfc6bf5a1bca56e6de3605cecdbbf37caaf14c9b0a98dda9bebfa64f6ee |