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

Built Distribution

File details

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

File metadata

File hashes

Hashes for minder_research_data_snapshots-0.19.0.tar.gz
Algorithm Hash digest
SHA256 4009f99c26c6ccfc1f8f07695d70dff98fa71b609d6a033ac2ea8b484f2d4d42
MD5 18f4cc0033f4ec49a1cc115ff025b4e3
BLAKE2b-256 c5a9a28b6fa10cd692ec53d527834c55ec2ad3498078823fe3bf134fbda6b6ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minder.research_data_snapshots-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5df1f70191b6843eac7f7b90461c067445afba67a8f9b0151dd398a14368292c
MD5 302f824f365ae06ff255aae8e12209ba
BLAKE2b-256 8cbc1a81066a8afbb6b3455744a9f05e0f8429724318a6465c018e73d1a9fc33

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