A client for the Abbott LibreLinkUp API
Project description
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 project.
Installation
To install pylibrelinkup, you can use pip:
pip install pylibrelinkup
Usage
Initialization
First, you need to import the necessary modules, initialize the client, and authenticate with your LibreLinkUp credentials:
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:
patient_list = client.get_patients()
print(patient_list)
Getting Patient data
PyLibreLinkUp provides three methods to retrieve patient data: current, graph, and logbook.
- The
currentmethod retrieves the most recent glucose measurement reported by the LLU api for a patient. - The
graphmethod retrieves the glucose measurements for the previous 12 hours which are used to display the recent history graph in the LLU app. - The
logbookmethod 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:
latest_glucose = client.latest(patient_identifier=patient_list[0])
print(latest_glucose)
Graph Data:
graph_data = client.graph(patient_identifier=patient_list[0])
print(graph_data)
Logbook Data:
logbook_data = client.logbook(patient_identifier=patient_list[0])
print(logbook_data)
full example:
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}")
For full documentation, please refer to the API documentation.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylibrelinkup-0.10.0.tar.gz.
File metadata
- Download URL: pylibrelinkup-0.10.0.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
608b363a2f61b58253daf53ffdd5bcd643d6791796f0e2d406b4df75639e21b4
|
|
| MD5 |
55e2427abf726ab670c3d59745222cc2
|
|
| BLAKE2b-256 |
f6380c41e5f4933bb373bae085161a3fe6c4338694a1124182bd6b1560a6d2b1
|
Provenance
The following attestation bundles were made for pylibrelinkup-0.10.0.tar.gz:
Publisher:
python-publish.yml on robberwick/pylibrelinkup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylibrelinkup-0.10.0.tar.gz -
Subject digest:
608b363a2f61b58253daf53ffdd5bcd643d6791796f0e2d406b4df75639e21b4 - Sigstore transparency entry: 1004900517
- Sigstore integration time:
-
Permalink:
robberwick/pylibrelinkup@097205e3ad8f07cb7945dce7c19f0ca97740fdc1 -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/robberwick
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@097205e3ad8f07cb7945dce7c19f0ca97740fdc1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pylibrelinkup-0.10.0-py3-none-any.whl.
File metadata
- Download URL: pylibrelinkup-0.10.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b09fad8214a39b4c9787bfc2657a04f16f727801b6f055bc41ca2fa7cfdc426
|
|
| MD5 |
1dd4c0101761eb30095c332ef45f1d90
|
|
| BLAKE2b-256 |
6b58bb20e00bd8916596d0a9b5ca724ef18eef94c670626f6a197ed42230ce6d
|
Provenance
The following attestation bundles were made for pylibrelinkup-0.10.0-py3-none-any.whl:
Publisher:
python-publish.yml on robberwick/pylibrelinkup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylibrelinkup-0.10.0-py3-none-any.whl -
Subject digest:
0b09fad8214a39b4c9787bfc2657a04f16f727801b6f055bc41ca2fa7cfdc426 - Sigstore transparency entry: 1004900525
- Sigstore integration time:
-
Permalink:
robberwick/pylibrelinkup@097205e3ad8f07cb7945dce7c19f0ca97740fdc1 -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/robberwick
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@097205e3ad8f07cb7945dce7c19f0ca97740fdc1 -
Trigger Event:
release
-
Statement type: