Name | medconb-client JSON |
Version |
0.0.3
JSON |
| download |
home_page | None |
Summary | medconb-client is a Python client for the MedConB API. |
upload_time | 2025-02-06 14:09:06 |
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
[](https://github.com/Bayer-Group/medconb-client/actions)
[](https://bayer-group.github.io/medconb-client/)
[](https://mypy-lang.org/)
[](https://github.com/psf/black)
[](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 = client.get_codelist_by_name(
codelist_name="Coronary Artery Disease",
codelist_collection_name="Pacific AF [Sample]",
)
```
```python
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
```python
codelist = client.get_codelist(
codelist_id="9c4ad312-3008-4d95-9b16-6f9b21ec1ad9"
)
```
### Retrieve collections in your workspace
```python
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](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/da/a70fef2f17a229a8d77b7abb90c4333162628df1c437df3a5dd11c8c6a83/medconb_client-0.0.3.tar.gz",
"platform": null,
"description": "# MedConB Client\n\n[](https://github.com/Bayer-Group/medconb-client/actions)\n[](https://bayer-group.github.io/medconb-client/)\n[](https://mypy-lang.org/)\n[](https://github.com/psf/black)\n[](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 = client.get_codelist_by_name(\n codelist_name=\"Coronary Artery Disease\",\n codelist_collection_name=\"Pacific AF [Sample]\",\n)\n```\n\n```python\ncodelist = 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 = 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 = client.get_workspace()\n\ncollection_info = next(\n collection\n for collection in workspace_info.collections\n if collection.itemType == \"Codelist\"\n)\n\ncodelist = 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\n \n Copyright (c) 2024 Bayer AG\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "medconb-client is a Python client for the MedConB API.",
"version": "0.0.3",
"project_urls": null,
"split_keywords": [
"medconb",
" client",
" api",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0d7dd79f71fe6640cded956ae973ef499fc4300d2b523e5717ead8eaa32e6ee0",
"md5": "9c0c198e61523758c3535f794005ce33",
"sha256": "67742b352ec955a465c9da9ddbe5641c6108ec86189dc12f76ff07a62367f3dc"
},
"downloads": -1,
"filename": "medconb_client-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9c0c198e61523758c3535f794005ce33",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 7027,
"upload_time": "2025-02-06T14:09:04",
"upload_time_iso_8601": "2025-02-06T14:09:04.162934Z",
"url": "https://files.pythonhosted.org/packages/0d/7d/d79f71fe6640cded956ae973ef499fc4300d2b523e5717ead8eaa32e6ee0/medconb_client-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f0daa70fef2f17a229a8d77b7abb90c4333162628df1c437df3a5dd11c8c6a83",
"md5": "c7593b60f0fcaee69436121fc10d5630",
"sha256": "9199bf78473425d469e263054969a37300ae3f022755f33272f0e85dcd42f968"
},
"downloads": -1,
"filename": "medconb_client-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "c7593b60f0fcaee69436121fc10d5630",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 6293,
"upload_time": "2025-02-06T14:09:06",
"upload_time_iso_8601": "2025-02-06T14:09:06.655332Z",
"url": "https://files.pythonhosted.org/packages/f0/da/a70fef2f17a229a8d77b7abb90c4333162628df1c437df3a5dd11c8c6a83/medconb_client-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-06 14:09:06",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "medconb-client"
}