Metadata-Version: 2.4
Name: librehardwaremonitor-api
Version: 1.2.0
Summary: A Python API client for LibreHardwareMonitor
Home-page: https://github.com/Sab44/librehardwaremonitor-api
Author: Sab44
Author-email: 64696149+Sab44@users.noreply.github.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: aiohttp
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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 a `LibreHardwareMonitorData` object 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_id": "amdcpu-0", 
    #         "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:
```bash
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
