Skip to main content

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.16.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.16.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.

Metadata

Release files for libre-linkup-py 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libre-linkup-py 0.2.5
File Size Uploaded
libre_linkup_py-0.2.5.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libre-linkup-py 0.2.5
File Interpreter ABI Platform
libre_linkup_py-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 40.9 kB

Release files / libre_linkup_py-0.2.5.tar.gz

Download URL libre_linkup_py-0.2.5.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4a8851eb4dd3063589dcd97264e0b5d2bb640ff74d366570efe098c85981b876
BLAKE2b-256 checksum
How to use checksums
d452c05e34b5dde64dd6c4ed82f1f10d5119ad940621980e399cc9d1260310ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.3

Release files / libre_linkup_py-0.2.5-py3-none-any.whl

Download URL libre_linkup_py-0.2.5-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a4abb6cf94ff0d997ff38a9f9c31c814bca500805dffc5abbea690338e98493
BLAKE2b-256 checksum
How to use checksums
b577258dbc1af71f75d5c0a3bd65cbb246412fd3cd9b93a3d86c0a34b9302472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.3

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page