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/

export RESEARCH_PORTAL_TOKEN_PATH=/path/to/access/token

Then use one of the following methods to retrieve data snapshots

CLI

python -m minder.research_data_snapshots --dataset patients raw_heart_rate --organization ELM4RQF8R9dsU3CZEgtiTW 7LcACpK4u12HH72D1etd5X

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

If you only intend to use the command line interface then you can use pipx to prevent clashes with other package versions and to avoid installation altogether:

pipx run minder.research-data-snapshots

Library

python -m pip install 'pandas[parquet]'
from datetime import datetime

import pandas as pd

from minder.research_data_snapshots import download_datasets

path = download_datasets(["patients"], ["ELM4RQF8R9dsU3CZEgtiTW"])[0]
df = pd.read_parquet(path)
print(df)

paths = download_datasets(["raw_heart_rate"])
df = pd.concat(
    pd.read_parquet(
        path,
        filters=[
            ("start_date", ">=", datetime.fromisoformat("2023-01-01T00Z")),
            ("start_date", "<", datetime.fromisoformat("2024-01-01T00Z")),
        ],
        columns=["id", "patient_id", "start_date"],
    )
    for path in paths
).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.16.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for minder_research_data_snapshots-0.16.0.tar.gz
Algorithm Hash digest
SHA256 c159943189abcdd781a37fd0e2d80a6de231ec8b37737bffbf2e345349e43aa9
MD5 d2c53afea068344f3a6c4506a2cfc032
BLAKE2b-256 781643f3754b4d2bea17467f1c5e1dcea2c488a7a0c6b62b057e5198b336d5c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minder.research_data_snapshots-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 648aeb8cc13a44e4d869a317b9ba4014c5a757e24bddf2bf422fdfe77fda03fb
MD5 bd0c2c8f655b8f2e39e067929470ef84
BLAKE2b-256 5cfaaa5993d90d66454bb8fcdf28c267aec7feff6881d92d020e8be8be9c622b

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