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
import tempfile
from datetime import datetime
from pathlib import Path

import pandas as pd

from minder.research_data_snapshots import download_datasets

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

folder = Path(tempfile.gettempdir()) / "research-data-snapshots"
download_datasets(["patients", "raw_heart_rate"], folder=folder)
df = (
    pd.read_parquet(
        folder / "raw_heart_rate",
        filters=[
            ("start_date", ">=", datetime.fromisoformat("2023-01-01T00Z")),
            ("start_date", "<", datetime.fromisoformat("2024-01-01T00Z")),
        ],
        columns=["patient_id", "start_date", "value"],
    )
    .sort_values("start_date")
    .reset_index(drop=True)
)
print(df)

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

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for minder_research_data_snapshots-0.21.0.tar.gz
Algorithm Hash digest
SHA256 ca85266a73612554768c82193cc219265d9fbf218f1b9d4c69a5f51a2f83b90f
MD5 45f26d64b76900f3215e7a4518651f12
BLAKE2b-256 71f9966776dee9ccb8d3b5e1f0fc16f14f95db1eb776b611a8653de060125f88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minder.research_data_snapshots-0.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3abbdc4547176668966a0cbcd5151430fefd49468251f1378d0447dbf79172f
MD5 5a4a175e1a09c5890d1a233ccf2fd2f3
BLAKE2b-256 9ffe386e9f98ba98942ae51801353df4e0cd34bafaf5ebd8125ea9b2166f686d

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