Skip to main content

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)

Source distribution for minder.research_portal_client 0.1.10
File Size Uploaded
minder_research_portal_client-0.1.10.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minder.research_portal_client 0.1.10
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page