Skip to main content

Unofficial libre linkup python client

Project description

Libre-linkup-py

TL;DR

Unofficial client to get your glucose readings from the LibreLinkUp API in Python. Supports Python 3.9 and above

Contents

Installation

pip install libre-linkup-py

Usage

Note: I recommend using something like python-dotenv to manage your environment variables.

  1. Create a .env file with the following contents:
LIBRE_LINK_UP_USERNAME=...
LIBRE_LINK_UP_PASSWORD=...
LIBRE_LINK_UP_URL=https://api-eu2.libreview.io
LIBRE_LINK_UP_VERSION=4.7.0  # Optional

The url for LIBRE_LINK_UP_URL may be different depending on where you live, current options, also see here for more information.

  1. Paste this code into a file and run it:
from libre_link_up import LibreLinkUpClient
import os
import dotenv
import json

dotenv.load_dotenv()

client = LibreLinkUpClient(
    username=os.environ["LIBRE_LINK_UP_USERNAME"],
    password=os.environ["LIBRE_LINK_UP_PASSWORD"],
    url=os.environ["LIBRE_LINK_UP_URL"],
    version="4.7.0",
)
client.login()
glucose_data = client.get_latest_reading()
print(json.dumps(glucose_data.model_dump(), sort_keys=True, indent=4))

The output should look something like:

{
    "high_at_the_time": false,
    "low_at_the_time": false,
    "unix_timestamp": 1709830900.0,
    "value": 7.9,
    "value_in_mg_per_dl": 143.0
}

Examples

See the examples directory for more examples.

Contributing

If you find a bug :bug:, please open a bug report. If you have an idea for an improvement or new feature :rocket:, please open a feature request.

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

libre_linkup_py-0.2.3.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

libre_linkup_py-0.2.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file libre_linkup_py-0.2.3.tar.gz.

File metadata

  • Download URL: libre_linkup_py-0.2.3.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.2

File hashes

Hashes for libre_linkup_py-0.2.3.tar.gz
Algorithm Hash digest
SHA256 2970425e4c169991b1847128672797f13a81534d5ea74f3a32f4e8dca74c26bc
MD5 15c2d051654c4dc58a0d01b886dd7c35
BLAKE2b-256 052000faac60fc4bae8bbbf119f8a51162d7d721ceac9884f5f832c83d3abb1c

See more details on using hashes here.

File details

Details for the file libre_linkup_py-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for libre_linkup_py-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b73a794b60fd2332f6c90e0bb2401af0875ec9958045dd2ef4e451b1a6d20569
MD5 132a7fc2ad3a2fa302c4bfa3c7a7d9c9
BLAKE2b-256 98c51be7388e39b5d40cd7901e4072f8f757612dce550e32f0a439fa4bc98536

See more details on using hashes here.

Supported by

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