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
Release history Release notifications | RSS feed
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.21.0.tar.gz
.
File metadata
- Download URL: minder_research_data_snapshots-0.21.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca85266a73612554768c82193cc219265d9fbf218f1b9d4c69a5f51a2f83b90f |
|
MD5 | 45f26d64b76900f3215e7a4518651f12 |
|
BLAKE2b-256 | 71f9966776dee9ccb8d3b5e1f0fc16f14f95db1eb776b611a8653de060125f88 |
File details
Details for the file minder.research_data_snapshots-0.21.0-py3-none-any.whl
.
File metadata
- Download URL: minder.research_data_snapshots-0.21.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3abbdc4547176668966a0cbcd5151430fefd49468251f1378d0447dbf79172f |
|
MD5 | 5a4a175e1a09c5890d1a233ccf2fd2f3 |
|
BLAKE2b-256 | 9ffe386e9f98ba98942ae51801353df4e0cd34bafaf5ebd8125ea9b2166f686d |