Name | medconb-client JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | medconb-client is a Python client for the MedConB API. |
upload_time | 2025-01-17 16:55:47 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2024 Bayer AG Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
medconb
client
api
python
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# MedConB Client
[![Build Status](https://github.com/Bayer-Group/medconb-client/actions/workflows/ci.yaml/badge.svg)](https://github.com/Bayer-Group/medconb-client/actions)
[![Documentation](https://img.shields.io/badge/Documentation-526CFE?logo=MaterialForMkDocs&logoColor=white)](https://bayer-group.github.io/medconb-client/)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Linting: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
This library provides a Python interface to the MedConB API. With this you can easily retrieve whole codelists from MedConB.
## Installation
This package is not yet published to pipy.
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:
```python
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
```python
codelist = await client.get_codelist_by_name(
codelist_name="Coronary Artery Disease",
codelist_collection_name="Pacific AF [Sample]",
)
```
```python
codelist = await 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
```python
codelist = await client.get_codelist(
codelist_id="9c4ad312-3008-4d95-9b16-6f9b21ec1ad9"
)
```
### Retrieve collections in your workspace
```python
workspace_info = await client.get_workspace()
collection_info = next(
collection
for collection in workspace_info.collections
if collection.itemType == "Codelist"
)
codelist = await client.get_codelist(collection_info.items[0].id)
```
For more information, also see our [Examples Page](https://refactored-adventure-kgjn1rq.pages.github.io/examples/).
Raw data
{
"_id": null,
"home_page": null,
"name": "medconb-client",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "medconb, client, api, python",
"author": null,
"author_email": "Alexander Vowinkel <alexander.vowinkel@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/f0/a2/32d51dccae99de8c9faf1e5be6cb4d56455b05cb050cfe1f52de4cc6eeb2/medconb_client-0.0.2.tar.gz",
"platform": null,
"description": "# MedConB Client\n\n[![Build Status](https://github.com/Bayer-Group/medconb-client/actions/workflows/ci.yaml/badge.svg)](https://github.com/Bayer-Group/medconb-client/actions)\n[![Documentation](https://img.shields.io/badge/Documentation-526CFE?logo=MaterialForMkDocs&logoColor=white)](https://bayer-group.github.io/medconb-client/)\n[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Linting: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\nThis library provides a Python interface to the MedConB API. With this you can easily retrieve whole codelists from MedConB.\n\n## Installation\n\nThis package is not yet published to pipy.\n\nYou can install (and update) it into your python environment by running:\n\n```\npip install --force-reinstall -U medconb-client\n```\n\n## Usage\n\nTo use it, you need to create a client:\n\n```python\nfrom medconb_client import Client\n\nendpoint = \"https://api.medconb.example.com/graphql/\"\ntoken = get_token()\n\nclient = Client(endpoint, token)\n```\n\nwith that client you can now interact with the API.\n\n### Get a codelist by name\n\n```python\ncodelist = await client.get_codelist_by_name(\n codelist_name=\"Coronary Artery Disease\",\n codelist_collection_name=\"Pacific AF [Sample]\",\n)\n```\n\n```python\ncodelist = await client.get_codelist_by_name(\n codelist_name=\"Coronary Artery Disease\",\n phenotype_collection_name=\"[Sample] PACIFIC AF ECA\",\n phenotype_name=\"Coronary Artery Disease\",\n)\n```\n\n### Get a codelist by id\n\n```python\ncodelist = await client.get_codelist(\n codelist_id=\"9c4ad312-3008-4d95-9b16-6f9b21ec1ad9\"\n)\n```\n\n### Retrieve collections in your workspace\n\n```python\nworkspace_info = await client.get_workspace()\n\ncollection_info = next(\n collection\n for collection in workspace_info.collections\n if collection.itemType == \"Codelist\"\n)\n\ncodelist = await client.get_codelist(collection_info.items[0].id)\n```\n\nFor more information, also see our [Examples Page](https://refactored-adventure-kgjn1rq.pages.github.io/examples/).\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Bayer AG Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "medconb-client is a Python client for the MedConB API.",
"version": "0.0.2",
"project_urls": null,
"split_keywords": [
"medconb",
" client",
" api",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cc791a546ae31cd4206df4645fdb4d8a01bfdadc176758e4ab5d9bb6a73a5f1a",
"md5": "7f709eb44eb596bedc8b5b8b9ae6201a",
"sha256": "2710ef45862d5ef272962b2da4f37b64f452dc2a16cadb42ac07d179f5bd193e"
},
"downloads": -1,
"filename": "medconb_client-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7f709eb44eb596bedc8b5b8b9ae6201a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 7058,
"upload_time": "2025-01-17T16:55:46",
"upload_time_iso_8601": "2025-01-17T16:55:46.748848Z",
"url": "https://files.pythonhosted.org/packages/cc/79/1a546ae31cd4206df4645fdb4d8a01bfdadc176758e4ab5d9bb6a73a5f1a/medconb_client-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f0a232d51dccae99de8c9faf1e5be6cb4d56455b05cb050cfe1f52de4cc6eeb2",
"md5": "b386f20ff992ee9f07a5462da09880e9",
"sha256": "3face53c884bc5bb6d550785d8d9e0a2a5e7136b96adb878d9760b86fe95a78f"
},
"downloads": -1,
"filename": "medconb_client-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "b386f20ff992ee9f07a5462da09880e9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 6323,
"upload_time": "2025-01-17T16:55:47",
"upload_time_iso_8601": "2025-01-17T16:55:47.885522Z",
"url": "https://files.pythonhosted.org/packages/f0/a2/32d51dccae99de8c9faf1e5be6cb4d56455b05cb050cfe1f52de4cc6eeb2/medconb_client-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-17 16:55:47",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "medconb-client"
}