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.
Contents
Installation
pip install libre-linkup-py
Usage
Note: I recommend using something like python-dotenv to manage your environment variables.
- 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.
- 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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file libre_linkup_py-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: libre_linkup_py-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c1f80aec82c551509cb025230c1fed79ba4505b5c7d9f6380945f78bda4925 |
|
MD5 | 46de524c8896bb6a577498995bc7119e |
|
BLAKE2b-256 | 3f228977925fc99341a956e26cff6765349d7e679da75868db9707e385d8d333 |