Skip to main content

No project description provided

Project description

Research Portal Client

Library to interact with Minder Research APIs.

Example

import logging
import asyncio
import datetime
from minder.research_portal_client import Configuration, JobManager
from minder.research_portal_client.models import ExportJobRequest, ExportJobRequestDataset


logging.basicConfig(level="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)
        await job_manager.download(job)


async def example2():
    job_id = "c25249e0-82ff-43d1-9676-f3cead0228b9"
    async with JobManager() as job_manager:
        await job_manager.download(job_id)


async def main():
    await example1()
    await example2()

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Development

Useful commands

Run tests

poetry 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)
poetry run coverage run -m pytest && poetry run coverage report -m

Linting

poetry run flake8

Formatting

poetry run black .

Type Checking

poetry run mypy .

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_portal_client-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file minder.research_portal_client-0.1.0.tar.gz.

File metadata

File hashes

Hashes for minder.research_portal_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 504de326208acaaaf54597687bfc3178871578e597c852e270b9db4a4db9bc90
MD5 0640e2f5cc87f58a8194638a285a01f2
BLAKE2b-256 4854c7928081cb745f26db28ab07102983a1ab845c5b6db764da8d02f8a244ad

See more details on using hashes here.

File details

Details for the file minder.research_portal_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for minder.research_portal_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09db8bec56e6bacdfbf5610fb0bbc1793f43411ff2f3a0e64c3c23235f1036e0
MD5 ba0b4036f8e8e063284cbb70f32a2585
BLAKE2b-256 ad5d1f247ef9519fe2f13a758c3573e0df3b124dae5ddaa352962a665d67ee68

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