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
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:
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
File details
Details for the file pylibrelinkup-0.6.1.tar.gz
.
File metadata
- Download URL: pylibrelinkup-0.6.1.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f042c0512b19adc2d206559bb27f0a92d35b53b3ba8bfb55b93919f25c269b3 |
|
MD5 | 3a89ad70e5667c96c10c326fc7b59f89 |
|
BLAKE2b-256 | fa251789920c55668d4aac1d636f87e1f53dc20d0fd4222d88e7b5091b9fa668 |
Provenance
The following attestation bundles were made for pylibrelinkup-0.6.1.tar.gz
:
Publisher:
python-publish.yml
on robberwick/pylibrelinkup
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pylibrelinkup-0.6.1.tar.gz
- Subject digest:
6f042c0512b19adc2d206559bb27f0a92d35b53b3ba8bfb55b93919f25c269b3
- Sigstore transparency entry: 151051336
- Sigstore integration time:
- Predicate type:
File details
Details for the file pylibrelinkup-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: pylibrelinkup-0.6.1-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f8156b6efd25c7a48dc81bc5e64a7a4e72ba5511c197df685773f46ca1a2326 |
|
MD5 | 595b1c954820c1781c65daf132453b57 |
|
BLAKE2b-256 | a1cc1439b860550160d081c50cbd7f1402e7ba018e2b061e726fb7b7acfbdd5a |
Provenance
The following attestation bundles were made for pylibrelinkup-0.6.1-py3-none-any.whl
:
Publisher:
python-publish.yml
on robberwick/pylibrelinkup
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pylibrelinkup-0.6.1-py3-none-any.whl
- Subject digest:
5f8156b6efd25c7a48dc81bc5e64a7a4e72ba5511c197df685773f46ca1a2326
- Sigstore transparency entry: 151051337
- Sigstore integration time:
- Predicate type: