Skip to main content

No project description provided

Project description

minder.research-data-snapshots

Install

python -m pip install minder.research-data-snapshots

This will provide exports in Parquet format, which should be sufficient if you're using Pandas or another dataframe library.

If you require exports in CSV format then use:

python -m pip install 'minder.research-data-snapshots[csv]'

Use

First retrieve an access token from https://research.minder.care/

Then use one of the following methods to retrieve data snapshots

CLI

python -m minder.research_data_snapshots --dataset patients raw_heart_rate --organization SABP "H&F" --token-path /path/to/access/token

Run python -m minder.research_data_snapshots --help to see all options

Library

python -m pip install 'pandas[parquet]'
export RESEARCH_PORTAL_TOKEN_PATH=/path/to/access/token
from datetime import datetime

import pandas as pd

from minder.research_data_snapshots import download_datasets

patients = pd.concat(pd.read_parquet(dataset) for dataset in download_datasets(["patients"], ["SABP", "H&F"]))

raw_heart_rate = (
    pd.concat(
        pd.read_parquet(
            path,
            filters=[
                ("start_date", ">=", datetime.fromisoformat("2023-01-01T00Z")),
                ("start_date", "<", datetime.fromisoformat("2024-01-01T00Z")),
            ],
            columns=["patient_id", "start_date", "value"],
        )
        for path in download_datasets(["raw_heart_rate"], ["SABP", "H&F"])
    )
    .sort_values("start_date")
    .reset_index(drop=True)
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minder_research_data_snapshots-0.22.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file minder_research_data_snapshots-0.22.0.tar.gz.

File metadata

File hashes

Hashes for minder_research_data_snapshots-0.22.0.tar.gz
Algorithm Hash digest
SHA256 f32337ade7df1a60f301aaf250d177517e98a50b57b7cbc986788708adf88cd4
MD5 54bf6fd8449f31530be7ccfad26b9ebf
BLAKE2b-256 2ee46ba2533833c18ab3d25e50edcbdb54f1e25c17cf47fee4faa8a2cb7c1c9f

See more details on using hashes here.

File details

Details for the file minder.research_data_snapshots-0.22.0-py3-none-any.whl.

File metadata

File hashes

Hashes for minder.research_data_snapshots-0.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32b7e78adb005789b71a88acc002acfe8126e91a81a4de6d6499b27b55ef0dd5
MD5 04315949ba38d959c1510de3212f0fae
BLAKE2b-256 f190827370890500549fdc4fa6c11385982b031047143aac0837a4dc184b4a08

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page