Skip to main content

medconb-client is a Python client for the MedConB API.

Project description

MedConB Client

Build Status Documentation Checked with mypy Code style: black Linting: Ruff

This library provides a Python interface to the MedConB API. With this you can easily retrieve whole codelists from MedConB.

Installation

You can install (and update) it into your python environment by running:

pip install --force-reinstall -U medconb-client

Usage

To use it, you need to create a client:

from medconb_client import Client

endpoint = "https://api.medconb.example.com/graphql/"
token = get_token()

client = Client(endpoint, token)

with that client you can now interact with the API.

Get a codelist by name

codelist = client.get_codelist_by_name(
    codelist_name="Coronary Artery Disease",
    codelist_collection_name="Pacific AF [Sample]",
)
codelist = client.get_codelist_by_name(
    codelist_name="Coronary Artery Disease",
    phenotype_collection_name="[Sample] PACIFIC AF ECA",
    phenotype_name="Coronary Artery Disease",
)

Get a codelist by id

codelist = client.get_codelist(
    codelist_id="9c4ad312-3008-4d95-9b16-6f9b21ec1ad9"
)

Retrieve collections in your workspace

workspace_info = client.get_workspace()

collection_info = next(
    collection
    for collection in workspace_info.collections
    if collection.itemType == "Codelist"
)

codelist = client.get_codelist(collection_info.items[0].id)

For more information, also see our Examples Page.

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

medconb_client-0.0.4.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

medconb_client-0.0.4-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file medconb_client-0.0.4.tar.gz.

File metadata

  • Download URL: medconb_client-0.0.4.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for medconb_client-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d0c217b98fbb8c3cdfa59dc71d534162ebe7f4363385896d46b470839f421d61
MD5 f914d74bb6006db3dbe3b2d062668703
BLAKE2b-256 c9506619b8e62bcd35bb89e82f4d8f9248e5f9c723e44ed7211ffd6437df6b66

See more details on using hashes here.

Provenance

The following attestation bundles were made for medconb_client-0.0.4.tar.gz:

Publisher: pypi.yml on Bayer-Group/medconb-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file medconb_client-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: medconb_client-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for medconb_client-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 70a7f703e7443586af675ad62741ccd19726faaadb14467d1fc6cb11b11cacd3
MD5 e0c98ae324d355e15fa329c88ef8f4eb
BLAKE2b-256 0cddfbeea0c37a2db37db384865de903f4391e09030e2f994167db0d3d06d85e

See more details on using hashes here.

Provenance

The following attestation bundles were made for medconb_client-0.0.4-py3-none-any.whl:

Publisher: pypi.yml on Bayer-Group/medconb-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page