Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

meds-reader

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meds-reader

A Pythonic interface for MEDS datasets

  • 0.1.9
  • PyPI
  • Socket score

Maintainers
1

meds_reader: A Pythonic interface for MEDS datasets

pypy docs Build wheels License

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc