Research Portal Client
Library to interact with Minder Research APIs.
Example
pip install minder.research-portal-client
import logging
import asyncio
import datetime
import sys
from minder.research_portal_client import Configuration, JobManager
from minder.research_portal_client.models import (
ExportJobRequest,
ExportJobRequestDataset,
)
logging.basicConfig(level=logging.INFO)
Configuration.set_default(
Configuration(
access_token="---REDACTED---",
)
)
async def example1():
async with JobManager() as job_manager:
now = datetime.datetime.today()
since = now - datetime.timedelta(days=7)
datasets: dict(str, ExportJobRequestDataset) = {
"patients": ExportJobRequestDataset(),
"observation_notes": ExportJobRequestDataset(),
}
export_job = ExportJobRequest(since, datasets=datasets)
job_id = await job_manager.submit(export_job)
job = await job_manager.wait(job_id)
files = await job_manager.download(job)
print(files)
async def example2():
job_id = "c25249e0-82ff-43d1-9676-f3cead0228b9"
async with JobManager() as job_manager:
files = await job_manager.download(job_id)
print(files)
async def example3():
async with JobManager() as job_manager:
datasets = await job_manager.client.info.list_datasets()
print(datasets)
organizations = await job_manager.client.info.list_organizations()
print(organizations)
reports = await job_manager.client.reports.list_reports()
print(reports)
async def main():
await example1()
await example2()
await example3()
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(main())
Development
Setup
uv sync
Run tests
uv run pytest
Code Coverage
This command consists of 2 parts:
- running tests with coverage collection
- formatting the report:
report(text to stdout),xml(GitLab compatible: cobertura),html(visual)
uv run coverage run -m pytest && uv run coverage report -m
Linting
uv run flake8
Formatting
uv run black .
Type Checking
uv run mypy .
Publishing
uv publish --token pypi-…
Metadata
Release files for minder.research_portal_client 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| minder_research_portal_client-0.1.10.tar.gz | 13.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| minder_research_portal_client-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.0 kB
Release files / minder_research_portal_client-0.1.10.tar.gz
| Download URL | minder_research_portal_client-0.1.10.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
573f2eb0374f4effba404c42a72c9c50d86444e1a73708e1acaee3f6f389703b
|
|
BLAKE2b-256 checksum How to use checksums |
460d24fff6bb630819824dd64eeb87a3d5db848590ce3acfb3587547a20eac21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.16
|
Release files / minder_research_portal_client-0.1.10-py3-none-any.whl
| Download URL | minder_research_portal_client-0.1.10-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6163436b5e69e26d1299ecef09d58a42dbb71ff57261eb9c6946c0e56cd2c7d
|
|
BLAKE2b-256 checksum How to use checksums |
3a3a802cbff5106da3e4b8c91ec31385911bbef7219774e178c602b5bcb16953
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.16
|