Lazy, privacy-aware code occurrence summaries for MEDS datasets
Project description
suMEDS
suMEDS creates a compact code catalog for defining tasks on very large
Medical Event Data Standard (MEDS)
datasets. It joins canonical descriptions and parent codes to event and unique-subject
counts, then masks or removes rare codes before writing Parquet, CSV, or JSON.
Polars scans, aggregations, joins, and writes stay lazy. Patient-level rows are never collected into Python memory.
Install and run
uv sync
uv run suMEDS MIMICIV_DEMO/MEDS_cohort \
--output code-summary.parquet \
--min-subjects 20
Or use YAML:
summary:
per_split: false
split_columns: false
privacy:
min_subjects: 20
min_split_subjects: 1
rare_code_action: bucket
rare_code_label: __RARE__
round_counts_to: 5
uv run suMEDS /path/to/MEDS -o summary.parquet -c examples/summary.yaml
# The suffix selects CSV or JSON instead:
uv run suMEDS /path/to/MEDS -o summary.json -c examples/summary.yaml
CLI flags override YAML. The defaults bucket codes seen in fewer than 20 unique subjects and retain exact counts.
Python API
from sumeds import SummaryConfig, summarize
path = summarize(
"/path/to/MEDS",
"code-summary.parquet",
SummaryConfig(min_subjects=20, rare_code_action="bucket"),
)
The output format is inferred from .parquet, .csv, or .json (with
.jsonl/.ndjson also supported). It preserves all code-metadata extension columns and adds
event_count, subject_count, and is_masked. per_split=True emits one row
per split. split_columns=True keeps the total row and adds columns such as
event_count_train and subject_count_train from subject_splits.parquet.
Set min_split_subjects above 1 to suppress rare split-level cells.
Documentation
uv run mkdocs serve
uv run mkdocs build --strict
See the documentation site for the data flow, complete CLI and YAML reference, output schema, Python API, and privacy limitations.
Development
uv run pre-commit run --all-files
uv run pytest
uv run mkdocs build --strict
The included integration test uses MIMICIV_DEMO/MEDS_cohort when present.
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sumeds-0.1.0.tar.gz.
File metadata
- Download URL: sumeds-0.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff5beed0748f88b935bf30354ca7eebb863d7d933e9fe6049b3cd51ed06888e5
|
|
| MD5 |
e4670ac7d2e030858e3befbb1429152a
|
|
| BLAKE2b-256 |
8bbe3c8f25bdcb270eac3671252da1c9a0db55a73e8756d6c95bb5be5fd11bd6
|
Provenance
The following attestation bundles were made for sumeds-0.1.0.tar.gz:
Publisher:
python-build.yaml on rvandewater/suMEDS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sumeds-0.1.0.tar.gz -
Subject digest:
ff5beed0748f88b935bf30354ca7eebb863d7d933e9fe6049b3cd51ed06888e5 - Sigstore transparency entry: 2211485598
- Sigstore integration time:
-
Permalink:
rvandewater/suMEDS@e8d0a09ee911785c367ae2db59aeb22598d9c7cb -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/rvandewater
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-build.yaml@e8d0a09ee911785c367ae2db59aeb22598d9c7cb -
Trigger Event:
push
-
Statement type:
File details
Details for the file sumeds-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sumeds-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08b1c57844b720bbc4b5a691c7633e18e870ee7600029b3d2c7adc2b3dce204b
|
|
| MD5 |
250d495eb2d793bd8c35bfa6e8f39bb1
|
|
| BLAKE2b-256 |
220c5e3c279d048a34cc41f738b117ccb032fbb9319ec7aef56e757ad5c574ee
|
Provenance
The following attestation bundles were made for sumeds-0.1.0-py3-none-any.whl:
Publisher:
python-build.yaml on rvandewater/suMEDS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sumeds-0.1.0-py3-none-any.whl -
Subject digest:
08b1c57844b720bbc4b5a691c7633e18e870ee7600029b3d2c7adc2b3dce204b - Sigstore transparency entry: 2211485606
- Sigstore integration time:
-
Permalink:
rvandewater/suMEDS@e8d0a09ee911785c367ae2db59aeb22598d9c7cb -
Branch / Tag:
refs/tags/0.0.1 - Owner: https://github.com/rvandewater
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-build.yaml@e8d0a09ee911785c367ae2db59aeb22598d9c7cb -
Trigger Event:
push
-
Statement type: