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 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()
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
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_portal_client-0.1.1.tar.gz
.
File metadata
- Download URL: minder.research_portal_client-0.1.1.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.8 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccbae8806983520403e9b264e572ea1402d5ad8b649ef87974afcb286affc87f |
|
MD5 | f8f0486756c361af73742f2b8b7c2d88 |
|
BLAKE2b-256 | 968fe6550153ec71bac0b833e85095cff499c496061f5e00dad4957190ac587f |
File details
Details for the file minder.research_portal_client-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: minder.research_portal_client-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.8 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4f2f69c9b47cd264605d70d75fc4752c186a060dc2699469837d6d5f927c91e |
|
MD5 | 7469f74149fc766f10f28a104d2f9355 |
|
BLAKE2b-256 | 50fd8e915133faf758d3017f67c9aa81e5d4dd48790f3f82ab781a7b7280d368 |