MIMIC-IV MEDS Extraction ETL
This pipeline extracts the MIMIC-IV dataset (from physionet) into the MEDS format.
Usage:
pip install MIMIC_IV_MEDS
export DATASET_DOWNLOAD_USERNAME=$PHYSIONET_USERNAME
export DATASET_DOWNLOAD_PASSWORD=$PHYSIONET_PASSWORD
MEDS_extract-MIMIC_IV root_output_dir=$ROOT_OUTPUT_DIR
When you run this, the program will:
- Download the needed raw MIMIC files for the currently supported version into
$ROOT_OUTPUT_DIR/raw_input. - Perform initial, pre-MEDS processing on the raw MIMIC files, saving the results in
$ROOT_OUTPUT_DIR/pre_MEDS. - Construct the final MEDS cohort, and save it to
$ROOT_OUTPUT_DIR/MEDS_cohort.
You can also specify the target directories more directly, with
export DATASET_DOWNLOAD_USERNAME=$PHYSIONET_USERNAME
export DATASET_DOWNLOAD_PASSWORD=$PHYSIONET_PASSWORD
MEDS_extract-MIMIC_IV raw_input_dir=$RAW_INPUT_DIR pre_MEDS_dir=$PRE_MEDS_DIR MEDS_cohort_dir=$MEDS_COHORT_DIR
Examples and More Info:
You can run MEDS_extract-MIMIC_IV --help for more information on the arguments and options. You can also run
MEDS_extract-MIMIC_IV root_output_dir=$ROOT_OUTPUT_DIR do_demo=True
to run the entire pipeline over the publicly available, fully open MIMIC-IV demo dataset.
Expected runtime and compute needs
This pipeline can be successfully run over the full MIMIC-IV on a 5-core machine leveraging around 165GB of memory in approximately 7 hours (note this time includes the time to download all of the MIMIC-IV files as well, and this test was run on a machine with poor network transfer speeds and without any parallelization applied to the transformation steps, so these speeds can likely be greatly increased). The output folder of data is 9.8 GB. This can be reduced significantly as well as intermediate files not necessary for the final MEDS dataset are retained in additional folders. See this github issue for tracking on ensuring these directories are automatically cleaned up in the future.
📚 Citing this work
If you use this software in your research, please cite it! You can use the "Cite this repository" button on GitHub.
The citation information is maintained in the CITATION.cff file in this repository.
🔧 Common Issues / FAQ
❓ Issue: FileNotFoundError or pipeline errors during the pre_MEDS step on Ubuntu (symlinks not recognized)
Problem:
Some users running the pipeline encounter errors during the pre_MEDS step, where the scripts attempt to create symlinks but later fails to recognize or access them — even though the symlinks appear to exist in the file system.
Solution:
A do_copy=True option is available in the CLI that allows the pipeline to copy files instead of symlinking, avoiding this issue entirely (at the cost of additional disk usage). You can enable this by adding do_copy=True to your command:
MEDS_extract-MIMIC_IV root_output_dir=$ROOT_OUTPUT_DIR do_copy=True
Metadata
Release files for MIMIC-IV-MEDS 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mimic_iv_meds-0.1.3.tar.gz | 99.7 kB | With provenance | Details for mimic_iv_meds-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mimic_iv_meds-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for mimic_iv_meds-0.1.3-py3-none-any.whl |
Total release size: 125.1 kB
Release files / mimic_iv_meds-0.1.3.tar.gz
| Download URL | mimic_iv_meds-0.1.3.tar.gz |
|---|---|
| Size | 99.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21f919987cea2f6b9a4f3928dcdb6bf048eb0ba006bcbc1c0a43162b33aac260
|
|
BLAKE2b-256 checksum How to use checksums |
08d3c7efad7a778c2ca62234757804050cc61b45b3075c06c72f80823751c3d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 7, 2026.
Transparency logRelease files / mimic_iv_meds-0.1.3-py3-none-any.whl
| Download URL | mimic_iv_meds-0.1.3-py3-none-any.whl |
|---|---|
| Size | 25.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d8e3e7a49854af751815e2db1293873f250c0d1902af8e03bde33cd7b265d5e
|
|
BLAKE2b-256 checksum How to use checksums |
f9542cd4bdfdcbf5430fd57be249310e14f36b28d9e27f0ccab99b5c9dd008ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 7, 2026.
Transparency logSecurity for MIMIC-IV-MEDS 0.1.3
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.
Attestation for mimic_iv_meds-0.1.3.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 Aug 7, 2026.
Transparency logA 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.