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.23.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

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

File metadata

File hashes

Hashes for minder_research_data_snapshots-0.23.0.tar.gz
Algorithm Hash digest
SHA256 9779dd7b20478c2edb6178b59d43558f9ded9c87aee4b621f88bbecde836bfa8
MD5 07b808101d4e88da51c0170dd06ab5fa
BLAKE2b-256 5b2571e2ccc2ac4bcaaa886000dbf7e1a2d0f1a07f1463613539b11fc55b03c6

See more details on using hashes here.

File details

Details for the file minder_research_data_snapshots-0.23.0-py3-none-any.whl.

File metadata

File hashes

Hashes for minder_research_data_snapshots-0.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b42d35d5ec0acd795bbaac344a436849e49cc670267e1d7c8cca7b1338bf3593
MD5 93b219c62678bb10244fe2cc302e398c
BLAKE2b-256 8a23da7c091f45e81f2a2d1c832121f0d79771ed0271513190bca30efe9dbdf1

See more details on using hashes here.

Supported by

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