A Python API client for LibreHardwareMonitor
Project description
LibreHardwareMonitor API Client
A Python library for interacting with the LibreHardwareMonitor API.
Overview
This library provides a simple interface for fetching data from the API provided by the inbuilt LibreHardwareMonitor web server.
Methods
The library provides one callable method:
get_data: Returns aLibreHardwareMonitorDataobject containing main device names and all sensor data from your Libre Hardware Monitor instance.
LibreHardwareMonitorData has 2 properties with the following structure:
LibreHardwareMonitorData(
main_device_names: list[str]
# for example:
# ["AMD Ryzen 7 7800X3D", "NVIDIA GeForce RTX 4080 SUPER"]
sensor_data: dict[str, LibreHardwareMonitorSensorData]
# for example
# {
# "amdcpu-0-power-0": {
# "name": Package Power",
# "value": "25,6",
# "min": "25,2",
# "max": "76,4",
# "unit": "W",
# "device_name": "AMD Ryzen 7 7800X3D",
# "device_type": "CPU",
# "sensor_id": "amdcpu-0-power-0"
# },
# "amdcpu-0-power-1" : { ... },
# ...
# }
# the dictionary keys represent a unique sensor id.
)
Installation
To install the library, run the following command:
pip install librehardwaremonitor-api
Usage
import asyncio
from librehardwaremonitor_api import LibreHardwareMonitorClient
async def main():
client = LibreHardwareMonitorClient("<HOSTNAME OR IP ADDRESS>", <PORT>)
lhm_data = await client.get_data()
print(lhm_data.main_device_names)
print(lhm_data.sensor_data)
asyncio.run(main())
TODO
- implement basic auth
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file librehardwaremonitor_api-1.1.3.tar.gz.
File metadata
- Download URL: librehardwaremonitor_api-1.1.3.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1073c2a169fb0d30e5540b7bf7c2600d0671fcea2ddc908b5a5546f1880f5b0
|
|
| MD5 |
7d2251fab33e96f41bf15cd13294e382
|
|
| BLAKE2b-256 |
853cd470d816207edc5948f22558906a28acf4e75ee5727a52d3fd08a73391bd
|
File details
Details for the file librehardwaremonitor_api-1.1.3-py3-none-any.whl.
File metadata
- Download URL: librehardwaremonitor_api-1.1.3-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c50c38252225aaf2d4f9b8384be082c2868377c38175c899ebbb8df0074aee1f
|
|
| MD5 |
c64787af2f3cd8e93ab42a5a3f63d543
|
|
| BLAKE2b-256 |
65dde801e227763dd4c513a5b487dd8b3e861cd27677b1546ad01ae056c0802b
|