Name | pylibrelinkup JSON |
Version |
0.6.0
JSON |
| download |
home_page | None |
Summary | A client for the Abbott LibreLinkUp API |
upload_time | 2024-11-16 13:38:34 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | MIT License Copyright (c) 2024 Rob Berwick 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 |
librelink
librelinkup
abbott
diabetes
glucose
api
client
health
medical
blood-sugar
continuous-glucose-monitoring
cgm
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pylibrelinkup
`pylibrelinkup` is a Python client for the LibreLinkUp API, which allows you to interact with the LibreLinkUp service to retrieve glucose data and other related information. This project is a Python implementation inspired by the [libre-link-up-api-client](https://github.com/DiaKEM/libre-link-up-api-client) project.
## Installation
To install `pylibrelinkup`, you can use `pip`:
```bash
pip install pylibrelinkup
```
## Usage
### Initialization
First, you need to import the necessary modules, initialize the client, and authenticate with your LibreLinkUp credentials:
```python
from pylibrelinkup import PyLibreLinkUp
client = PyLibreLinkUp(email='your_username', password='your_password')
client.authenticate()
```
### Getting Patient List
You can fetch the list of patients using the `get_patients` method:
```python
patient_list = client.get_patients()
print(patient_list)
```
### Getting Patient data
PyLibreLinkUp provides three methods to retrieve patient data: `current`, `graph`, and `logbook`.
- The `current` method retrieves the most recent glucose measurement reported by the LLU api for a patient.
- The `graph` method retrieves the glucose measurements for the previous 12 hours which are used to display the recent history graph in the LLU app.
- The `logbook` method retrieves the glucose event data for approximately the last two weeks.
All three methods accept a `patient_identifier` parameter in the form of a `UUID`, `str`, or `Patient` object.
**Note:** The `read` method also exists as a way to retrieve both recent and latest patient data, but it is deprecated and will be removed in a future release. Use the `graph` method for retrieving graph data and `latest` to access the most recent glucose measurement.
#### Current Glucose:
```python
latest_glucose = client.latest(patient_identifier=patient_list[0])
print(latest_glucose)
```
#### Graph Data:
```python
graph_data = client.graph(patient_identifier=patient_list[0])
print(graph_data)
```
#### Logbook Data:
```python
logbook_data = client.logbook(patient_identifier=patient_list[0])
print(logbook_data)
```
full example:
```python
from pylibrelinkup import PyLibreLinkUp
client = PyLibreLinkUp(email='your_username', password='your_password')
client.authenticate()
patient_list = client.get_patients()
print(patient_list)
patient = patient_list[0]
print(f"latest: {client.latest(patient_identifier=patient)}")
graph_data = client.graph(patient_identifier=patient)
print(f"graph data ({len(graph_data)} measurements):")
for measurement in graph_data:
print(f"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}")
logbook_data = client.logbook(patient_identifier=patient)
print(f"logbook data: ({len(logbook_data)} entries)")
for measurement in logbook_data:
print(f"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}")
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pylibrelinkup",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "librelink, librelinkup, abbott, diabetes, glucose, api, client, health, medical, blood-sugar, continuous-glucose-monitoring, cgm",
"author": null,
"author_email": "Rob Berwick <rob.berwick@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/9b/6e/8822d085b8bf32c8798f66a72c2cf18d9fc862dbe1266ca0f975def42782/pylibrelinkup-0.6.0.tar.gz",
"platform": null,
"description": "# pylibrelinkup\n\n`pylibrelinkup` is a Python client for the LibreLinkUp API, which allows you to interact with the LibreLinkUp service to retrieve glucose data and other related information. This project is a Python implementation inspired by the [libre-link-up-api-client](https://github.com/DiaKEM/libre-link-up-api-client) project.\n\n## Installation\n\nTo install `pylibrelinkup`, you can use `pip`:\n\n```bash\npip install pylibrelinkup\n```\n\n## Usage\n\n### Initialization\n\nFirst, you need to import the necessary modules, initialize the client, and authenticate with your LibreLinkUp credentials:\n\n```python\nfrom pylibrelinkup import PyLibreLinkUp\n\nclient = PyLibreLinkUp(email='your_username', password='your_password')\nclient.authenticate()\n```\n\n### Getting Patient List\n\nYou can fetch the list of patients using the `get_patients` method:\n\n```python\npatient_list = client.get_patients()\nprint(patient_list)\n```\n\n### Getting Patient data\n\nPyLibreLinkUp provides three methods to retrieve patient data: `current`, `graph`, and `logbook`. \n\n- The `current` method retrieves the most recent glucose measurement reported by the LLU api for a patient.\n- The `graph` method retrieves the glucose measurements for the previous 12 hours which are used to display the recent history graph in the LLU app.\n- The `logbook` method retrieves the glucose event data for approximately the last two weeks.\n\nAll three methods accept a `patient_identifier` parameter in the form of a `UUID`, `str`, or `Patient` object.\n\n**Note:** The `read` method also exists as a way to retrieve both recent and latest patient data, but it is deprecated and will be removed in a future release. Use the `graph` method for retrieving graph data and `latest` to access the most recent glucose measurement.\n\n#### Current Glucose:\n\n```python\nlatest_glucose = client.latest(patient_identifier=patient_list[0])\nprint(latest_glucose)\n```\n\n#### Graph Data:\n\n```python\ngraph_data = client.graph(patient_identifier=patient_list[0])\nprint(graph_data)\n```\n\n\n#### Logbook Data:\n\n```python\nlogbook_data = client.logbook(patient_identifier=patient_list[0])\nprint(logbook_data)\n```\n\nfull example:\n\n```python\nfrom pylibrelinkup import PyLibreLinkUp\n\nclient = PyLibreLinkUp(email='your_username', password='your_password')\nclient.authenticate()\npatient_list = client.get_patients()\nprint(patient_list)\npatient = patient_list[0]\nprint(f\"latest: {client.latest(patient_identifier=patient)}\")\ngraph_data = client.graph(patient_identifier=patient)\nprint(f\"graph data ({len(graph_data)} measurements):\")\nfor measurement in graph_data:\n print(f\"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}\")\nlogbook_data = client.logbook(patient_identifier=patient)\nprint(f\"logbook data: ({len(logbook_data)} entries)\")\nfor measurement in logbook_data:\n print(f\"{measurement.value} {measurement.timestamp} {measurement.factory_timestamp}\")\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Rob Berwick 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": "A client for the Abbott LibreLinkUp API",
"version": "0.6.0",
"project_urls": {
"Homepage": "https://github.com/robberwick/pylibrelinkup",
"Issues": "https://github.com/robberwick/pylibrelinkup/issues"
},
"split_keywords": [
"librelink",
" librelinkup",
" abbott",
" diabetes",
" glucose",
" api",
" client",
" health",
" medical",
" blood-sugar",
" continuous-glucose-monitoring",
" cgm"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6df77ac32da935e51dc1306f28ad3016604a245b9ad6e5db04cfe99d75a4e5ac",
"md5": "59871aecf8c3fb2801c544139e52ff0e",
"sha256": "114914ae9d7ce030f652daa12b9d59b73eedf5baaea4bb4895615e93dbddcfd2"
},
"downloads": -1,
"filename": "pylibrelinkup-0.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "59871aecf8c3fb2801c544139e52ff0e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 11909,
"upload_time": "2024-11-16T13:38:32",
"upload_time_iso_8601": "2024-11-16T13:38:32.877736Z",
"url": "https://files.pythonhosted.org/packages/6d/f7/7ac32da935e51dc1306f28ad3016604a245b9ad6e5db04cfe99d75a4e5ac/pylibrelinkup-0.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b6e8822d085b8bf32c8798f66a72c2cf18d9fc862dbe1266ca0f975def42782",
"md5": "b91f9957f07cdc97f7cfe257e23ece5e",
"sha256": "5f131b0692e56e2e21a9221b5cbdc2245950b95225e0febc4e7c56d7c7213d69"
},
"downloads": -1,
"filename": "pylibrelinkup-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "b91f9957f07cdc97f7cfe257e23ece5e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 19182,
"upload_time": "2024-11-16T13:38:34",
"upload_time_iso_8601": "2024-11-16T13:38:34.880680Z",
"url": "https://files.pythonhosted.org/packages/9b/6e/8822d085b8bf32c8798f66a72c2cf18d9fc862dbe1266ca0f975def42782/pylibrelinkup-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-16 13:38:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "robberwick",
"github_project": "pylibrelinkup",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pylibrelinkup"
}