Skip to main content

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.

PyPI - Python Version PyPI - Version PyPI - License Read the Docs PyPI - Downloads

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylibrelinkup-0.9.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylibrelinkup-0.9.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file pylibrelinkup-0.9.0.tar.gz.

File metadata

  • Download URL: pylibrelinkup-0.9.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylibrelinkup-0.9.0.tar.gz
Algorithm Hash digest
SHA256 5e35756485f0899cf60a8e22da5acb8fc829c4315d87eefc5094c520033f41f8
MD5 dc3341f4bfbbf73eb173dae22193b467
BLAKE2b-256 114c1ebf70a37d077e07ce3cad05125de70d74d95bad99dc83276b791aa6f94a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylibrelinkup-0.9.0.tar.gz:

Publisher: python-publish.yml on robberwick/pylibrelinkup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylibrelinkup-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pylibrelinkup-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylibrelinkup-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 837c1e20f97f71172d05dd9c09e3c5390bf44f8919c93cb1d9601bc45acc3c4a
MD5 ea0eeccb646ad2a076edc51b681f4f93
BLAKE2b-256 7359457ad32eeca8a7ad80a0c88f23a530bd44521e749cba360e2665ebdbc541

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylibrelinkup-0.9.0-py3-none-any.whl:

Publisher: python-publish.yml on robberwick/pylibrelinkup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page