Skip to content

A hardware monitoring project that provides high-performance tools, Python libraries, and C++ header files for retrieving and displaying detailed hardware information.

License

MIT, GPL-3.0 licenses found

Licenses found

MIT
LICENSE
GPL-3.0
LICENSE.GPL3
Notifications You must be signed in to change notification settings

gafoo173/HardView

HardView Logo

HardView - Hardware Information Project

PyPI Stable Version Version Supported Python versions

License License Platforms

Temperature Monitoring

A comprehensive hardware monitoring solution with Python, C++, and C libraries
Unified interface for developers β€’ Real-time monitoring β€’ Cross-platform support


πŸ“‹ Table of Contents

Overview β€’ Features β€’ Installation β€’ Usage β€’ Documentation β€’ API Reference β€’ Platform Support


πŸ“¦ HardView Project Overview

HardView is a project that includes Python, C++, and C libraries, Windows drivers, and tools for monitoring hardware and displaying its information through various sources, whether from the system or other libraries. It provides a unified interface for developers to access information via libraries and a user interface for end-users through the tools.

Libraries & Components
Library Name Description Language Purpose / Features
HardView Legacy library providing static hardware information for Windows and Linux. Uses WMI and old query methods β€” kept for compatibility only. C Legacy (superseded by LiveView & SMBIOS)
LiveView A monitoring library for both static hardware info and real-time data. Supports CPU temperature and regular usage on Windows and Linux C++ Real-time monitoring of hardware metrics, integrates static info and CPUID functions.
HardwareWrapper An internal library wrapping LibreHardwareMonitorLib with simple functions through C++/CLI, allowing use from C++. Primarily used by LiveView on Windows for temperature readings. C++/CLI Simplifies access to LibreHardwareMonitorLib, providing easy C++ usage for Windows sensor data.
cpuid An internal, header-only C++ library providing easy helper functions to access most CPUID information. Used by LiveView for CPUID-related functionality. C++ Lightweight, easy-to-integrate CPUID helper library for detailed processor information.
C++/Headers A folder containing header-only C++ libraries like SMART.hpp (for SMART info) or Live.hpp (C++ header-only version of LiveView), and others. C++ Header-only C++ modules for advanced hardware access and monitoring.
Drivers A set of Windows kernel drivers granting access to low-level hardware functionality useful for monitoring. Each driver comes with a header-only C++ library for easier integration. These drivers are not used by the main HardView libraries (Python or C++) since they are unsigned. They are provided for those who wish to sign and use them, or for personal use with local build and test signing. C/C++ Optional drivers for advanced hardware access under Windows. Not required for standard HardView usage.
Tools A collection of CLI and GUI Python tools that rely on HardView to display hardware information. Python Command-line and GUI utilities for interacting with hardware info provided by HardView.

✨ Key Features

πŸ”§ Hardware Information

  • Comprehensive Hardware Data: BIOS, System, Baseboard, Chassis, CPU, RAM, Disks, Network, GPU
  • Advanced Storage & SMART: Detailed disk, partition, and SMART attributes
  • Cross-Platform Support: Windows and Linux compatibility

πŸ“Š Performance Monitoring

  • Real-time Monitoring: CPU, RAM, Disk, Network, GPU usage
  • Temperature & Sensors: Live temperature, voltage, and fan speed readings

πŸ’» Implementation

  • C/C++ Core: High performance native code
  • Python Integration: Easy-to-use Python API
  • Header-Only Libraries: Simple integration for C++ projects

🌑️ Temperature Monitoring

Windows: Uses LibreHardwareMonitor (MPL-2.0)
Linux: Uses lm-sensors (LGPL-2.1-or-later)
See licenses/ for full license texts


πŸš€ Installation (Python)

From PyPI

pip install hardview

From Source

git clone https://github.com/gafoo173/hardview.git
cd hardview
pip install .
πŸ“š Full setup instructions and platform support

For supported platforms and full setup instructions, see docs/INSTALL.md.


πŸ“¦ Dependencies

Python (Windows)

Requires LibreHardwareMonitorLib.dll and HidSharp.dll.
These DLLs are included in the package, so no separate installation is needed.

Windows Temperature Information Features

The temperature information features in Windows specifically require the MSVC Runtime, namely the following DLLs on 64-bit systems:

  • msvcp140.dll
  • vcruntime140.dll
  • vcruntime140_1.dll

If you place these DLLs alongside HardwareWrapper.dll, the temperature-related functions will likely work properly even if you haven't installed the full MSVC runtime.
(This applies whether you are using the Python LiveView or the HardwareTemp.dll from the SDK; in all cases, these libraries are required.)

In HardView Python versions 3.2.0+, these DLLs are already included alongside the package, so you don't need to place them manually.

Python (Linux)

Requires the lm-sensors library to be installed for hardware monitoring.

C++ Libraries

Check the top of each library header file for listed dependencies.
Most libraries have no external dependencies.
Exception: SPD.hpp requires InpOutx64.dll.
It is recommended to review the header file beginning for any dependency notes.


⚠️ Potential Issues on Windows

HardView.LiveView Temperature Features

The temperature monitoring features in HardView.LiveView rely on LibreHardwareMonitorLib, which in turn uses on WinRing0.
WinRing0 is an old and well-known driver used for reading from MSR, physical memory, and other low-level hardware resources.

The Problem

WinRing0 is now blocked by Windows.
This means you may encounter alerts from Windows Defender similar to this one:

Windows Defender Alert

You'll notice that python.sys is reported as the suspicious driver.
This has nothing to do with Python itself. What actually happens is:

  • LibreHardwareMonitorLib, when creating its driver, names it as <ProgramName>.sys.
  • Since Python scripts run under python.exe, the driver ends up named python.sys.
  • In reality, this file is just the WinRing0 driver renamed.

Is It Dangerous?

  • WinRing0 is just a driver that grants access to resources that normally require kernel-mode from user-mode. The danger only arises if a malicious program abuses it.
  • The driver created by LibreHardwareMonitorLib is temporary. It will be stop automatically when you restart your system.

It's recommended to delete the driver using sc delete or remove its file after the program finishes, to prevent any malicious software from exploiting it.

Manually Stopping or Removing the Driver

If you want to close or remove the driver manually after running your script/program:

  1. Open CMD as Administrator.
  2. Run the following command to stop the driver:
sc stop R0<ProgramName>
  • For Python scripts:
    sc stop R0Python
  • For an executable program named X.exe:
    sc stop R0X
  1. To permanently delete the driver, run:
sc delete R0Python

After that, you can manually delete the driver file.


πŸ’‘ Usage Examples

HardView (Not recommended for monitoring in 3.1.0+. It's better to use LiveView)
import HardView
import json

# JSON output
bios_json = HardView.get_bios_info()
cpu_json = HardView.get_cpu_info() #In Linux all outputs N/A in this function 

# Python objects output
#You must pass the parameter `false` in versions prior to 3.0.3, e.g. `HardView.get_bios_info_objects(false)`.

bios_objects = HardView.get_bios_info_objects() 
cpu_objects = HardView.get_cpu_info_objects() #On Linux, all outputs of this function show N/A It is recommended in 3.1.0+ to use the cpuid function from LiveView.PyLiveCPU.

# Performance monitoring
cpu_usage_json = HardView.get_cpu_usage()
ram_usage_objects = HardView.get_ram_usage_objects()

# Monitor over time
cpu_monitor_json = HardView.monitor_cpu_usage_duration(5, 1000)
ram_monitor_objects = HardView.monitor_ram_usage_duration_objects(3, 500) 

# Pretty print CPU info
import pprint
pprint.pprint(json.loads(cpu_json))
LiveView
from HardView.LiveView import PyLiveCPU, PyLiveRam, PyLiveDisk, PyLiveNetwork
import time

# Initialize system monitors
cpu_monitor = PyLiveCPU()         # CPU usage monitor
ram_monitor = PyLiveRam()         # RAM usage monitor
disk_monitor = PyLiveDisk(mode=1) # Disk R/W speed monitor (mode 1 for MB/s)
net_monitor = PyLiveNetwork()     # Network traffic monitor

print("System Monitor - Single Reading")
print("-" * 40)

# Get system metrics with 1-second sampling interval
cpu_usage = cpu_monitor.get_usage(1000)           # CPU percentage
ram_usage = ram_monitor.get_usage()               # RAM percentage
disk_rw = disk_monitor.get_usage(1000)            # Returns [(Read MB/s), (Write MB/s)]
net_traffic = net_monitor.get_usage(1000, mode=0) # Total network MB/s

# Display current system status
print(f"CPU: {cpu_usage:5.1f}% | RAM: {ram_usage:5.1f}% | "
      f"Disk R/W: {disk_rw[0][1]:4.1f}/{disk_rw[1][1]:4.1f} MB/s | "
      f"Network: {net_traffic:6.3f} MB/s")
      
print("Monitoring complete.")
LiveView (temperature) - Requires admin privileges
#!/usr/bin/env python3
import sys

# Check CPU temperature - single reading
if sys.platform == "win32":
    # Windows CPU temperature
    try:
        from HardView.LiveView import PyTempCpu
        cpu_temp = PyTempCpu()  # Auto-initialize
        temperature = cpu_temp.get_temp()
        print(f"CPU Temperature: {temperature:.1f}Β°C")
    except Exception as e:
        print(f"Windows temperature error: {e}")
        
elif sys.platform == "linux":
    # Linux CPU temperature  
    try:
        from HardView.LiveView import PyLinuxSensor
        sensor = PyLinuxSensor()
        temperature = sensor.getCpuTemp()
        if temperature > 0:
            print(f"CPU Temperature: {temperature:.1f}Β°C")
        else:
            print("CPU temperature not available")
    except Exception as e:
        print(f"Linux temperature error: {e}")
        
else:
    print("Unsupported platform")
SMBIOS - (3.2.0+)
#This code will work on Windows only.
from HardView import smbios

# Get all system information
info = smbios.get_system_info()

# Display system details
print("=" * 60)
print("SYSTEM INFORMATION")
print("=" * 60)
print(f"Manufacturer:    {info.system.manufacturer}")
print(f"Product Name:    {info.system.product_name}")
print(f"Version:         {info.system.version}")
print(f"Serial Number:   {info.system.serial_number}")
print(f"UUID:            {info.system.uuid}")
print(f"SKU Number:      {info.system.sku_number}")
print(f"Family:          {info.system.family}")

print("\n" + "=" * 60)
print("BIOS INFORMATION")
print("=" * 60)
print(f"Vendor:          {info.bios.vendor}")
print(f"Version:         {info.bios.version}")
print(f"Release Date:    {info.bios.release_date}")
print(f"BIOS Version:    {info.bios.major_release}.{info.bios.minor_release}")

print("\n" + "=" * 60)
print("MOTHERBOARD INFORMATION")
print("=" * 60)
print(f"Manufacturer:    {info.baseboard.manufacturer}")
print(f"Product:         {info.baseboard.product}")
print(f"Version:         {info.baseboard.version}")
print(f"Serial Number:   {info.baseboard.serial_number}")
SMART - Requires admin privileges (3.3.0+)
#This code will work on Windows only.
from HardView import SMART

def generate_health_report(drive_number):
    try:
        reader = SMART.SmartReader(drive_number)
        
        print("\n" + "="*60)
        print(f"DRIVE HEALTH REPORT - {reader.drive_path}")
        print("="*60)
        
        # Basic Info
        print(f"\n Basic Information:")
        print(f"   Drive Type: {reader.get_drive_type()}")
        print(f"   SMART Valid: {reader.is_valid}")
        
        # Temperature
        temp = reader.get_temperature()
        if temp != -1:
            temp_status = "βœ“ Good" if temp < 50 else "  High"
            print(f"\n  Temperature: {temp}Β°C - {temp_status}")
        
        # Usage Statistics
        print(f"\n⏱️  Usage Statistics:")
        hours = reader.get_power_on_hours()
        print(f"   Power-On Hours: {hours} ({hours/24:.1f} days)")
        print(f"   Power Cycles: {reader.get_power_cycle_count()}")
        
        # Health Status
        print(f"\nπŸ’Š Health Status:")
        realloc = reader.get_reallocated_sectors_count()
        if realloc == 0:
            print(f"   Reallocated Sectors: βœ“ None (Excellent)")
        else:
            print(f"   Reallocated Sectors:   {realloc} (Needs Attention)")
        
        # SSD Specific
        if reader.is_probably_ssd():
            print(f"\n SSD Information:")
            life = reader.get_ssd_life_left()
            if life != -1:
                life_status = "βœ“ Good" if life > 80 else "  Monitor" if life > 50 else " Critical"
                print(f"   Life Remaining: {life}% - {life_status}")
            
            written = reader.get_total_bytes_written()
            if written > 0:
                written_tb = written / (1024**4)
                print(f"   Total Written: {written_tb:.2f} TB")
            
            read = reader.get_total_bytes_read()
            if read > 0:
                read_tb = read / (1024**4)
                print(f"   Total Read: {read_tb:.2f} TB")
        
        print("\n" + "="*60 + "\n")
        
    except Exception as e:
        print(f"Error generating report: {e}")

# Generate reports for all drives
readers, errors = SMART.scan_all_drives()
for i, reader in enumerate(readers):
    generate_health_report(i)
SDK Temperature (Rust) - Requires admin privileges
//This code will work on Windows only.
use libloading::{Library, Symbol};
use std::os::raw::{c_double, c_int};

type InitFn = unsafe extern "C" fn() -> c_int;
type ShutdownFn = unsafe extern "C" fn();
type GetTempFn = unsafe extern "C" fn() -> c_double;
type UpdateFn = unsafe extern "C" fn();

// Check if required DLLs exist next to the executable
fn check_dependencies() -> Result<(), String> {
    let required_dlls = ["HardwareTemp.dll", "HardwareWrapper.dll", "LibreHardwareMonitorLib.dll", "HidSharp.dll"];
    
    let exe_dir = std::env::current_exe()
        .map_err(|e| format!("Failed to get executable path: {}", e))?
        .parent()
        .ok_or("Failed to get executable directory")?
        .to_owned();

    let mut missing = Vec::new();
    for dll in &required_dlls {
        if !exe_dir.join(dll).exists() {
            missing.push(*dll);
        }
    }

    if !missing.is_empty() {
        return Err(format!("Missing DLLs: {}", missing.join(", ")));
    }
    Ok(())
}

fn main() {
    // Check dependencies first
    if let Err(error) = check_dependencies() {
        eprintln!("Error: {}", error);
        return;
    }

    // Load the library from executable directory
    let exe_dir = std::env::current_exe().unwrap().parent().unwrap().to_owned();
    let dll_path = exe_dir.join("HardwareTemp.dll");
    
    let lib = unsafe { 
        Library::new(&dll_path).expect("Failed to load HardwareTemp.dll") 
    };

    unsafe {
        // Load required functions
        let init: Symbol<InitFn> = lib.get(b"InitHardwareTempMonitor\0").expect("InitHardwareTempMonitor not found");
        let get_cpu_temp: Symbol<GetTempFn> = lib.get(b"GetCpuTemperatureTemp\0").expect("GetCpuTemperatureTemp not found");
        let update: Symbol<UpdateFn> = lib.get(b"UpdateHardwareMonitorTemp\0").expect("UpdateHardwareMonitorTemp not found");
        let shutdown: Symbol<ShutdownFn> = lib.get(b"ShutdownHardwareTempMonitor\0").expect("ShutdownHardwareTempMonitor not found");

        // Initialize hardware monitor
        let init_result = init();
        if init_result != 0 {
            eprintln!("Failed to initialize hardware monitor. Error code: {}", init_result);
            return;
        }

        // Update and get CPU temperature
        update();
        let cpu_temp = get_cpu_temp();

        // Display result
        match cpu_temp {
            -1.0 => println!("CPU Temperature: ERROR - Run as Administrator or sensor not supported"),
            -99.0 => println!("CPU Temperature: ERROR - Missing dependencies"),
            temp => println!("CPU Temperature: {:.1} Β°C", temp),
        }

        // Cleanup
        shutdown();
    }
}
MSR.hpp Example (C++) - needs MsrDrv.sys installed and running
//this code will work in intel only
#include "MSR.hpp"
#include <iostream>

int main() {
    try {
        // Create MSR driver instance
        MSR::MsrDriver driver;

        if (!driver.IsValid()) {
            std::cerr << "MSR driver not available!" << std::endl;
            return 1;
        }

        // Read CPU TjMax (maximum temperature)
        int tjMax = 0;
        if (MSR::Thermal::TryGetTjMax(driver, tjMax)) {
            std::cout << "CPU TjMax: " << tjMax << "Β°C" << std::endl;
        } else {
            std::cerr << "Failed to get TjMax." << std::endl;
        }

        // Read current CPU temperature
        int currentTemp = 0;
        if (MSR::Thermal::TryGetCurrentTemperature(driver, currentTemp)) {
            std::cout << "Current CPU Temperature: " << currentTemp << "Β°C" << std::endl;
        } else {
            std::cerr << "Failed to read CPU temperature." << std::endl;
        }

        // Read a specific MSR register (IA32_PLATFORM_ID)
        try {
            UINT64 platformId = driver.ReadMsr(MSR::Registers::IA32_PLATFORM_ID);
            std::cout << "IA32_PLATFORM_ID MSR: 0x" 
                      << std::hex << platformId << std::dec << std::endl;
        } catch (const MSR::MsrException& ex) {
            std::cerr << "Error reading MSR: " << ex.what() 
                      << " (code: " << ex.GetErrorCode() << ")" << std::endl;
        }

    } catch (const MSR::DriverNotLoadedException& ex) {
        std::cerr << "MSR driver not loaded: " << ex.what() << std::endl;
        return 2;
    } catch (const MSR::MsrException& ex) {
        std::cerr << "MSR Exception: " << ex.what() 
                  << " (code: " << ex.GetErrorCode() << ")" << std::endl;
        return 3;
    }

    return 0;
}
PhysMemDrv.hpp Example (C++) - needs PhysMemDrv.sys installed and running
#include "PhysMemDrv.hpp"
#include <iostream>
#include <iomanip>

int main() {
    try {
        PhysMemDriver::DriverHandle driver;
        uint8_t firstByte = driver.ReadPhysical<uint8_t>(0xF0000);
        std::cout << "BIOS first byte: 0x" 
                  << std::hex << std::setw(2) << std::setfill('0') 
                  << static_cast<int>(firstByte) << std::dec << std::endl;
    } catch (...) {
        std::cerr << "Failed to read BIOS ROM" << std::endl;
    }
}
SMART.hpp Example (C++) - requires Admin privileges
#include "SMART.hpp"
#include <iostream>
#include <vector>
#include <memory>

int main() {
    try {
        // Scan all available drives (0-7)
        auto drives = smart_reader::ScanAllDrives(8);

        for (const auto& drive : drives) {
            std::cout << "Drive: " << drive->GetDrivePath() << "\n";
            std::cout << "Type: " << drive->GetDriveType() << "\n";
            std::cout << "Temperature: " << drive->GetTemperature() << " Β°C\n";
            std::cout << "Power-On Hours: " << drive->GetPowerOnHours() << "\n";
            std::cout << "Power Cycle Count: " << drive->GetPowerCycleCount() << "\n";
            std::cout << "Reallocated Sectors: " << drive->GetReallocatedSectorsCount() << "\n";

            if (drive->IsProbablySsd()) {
                std::cout << "SSD Life Left: " << drive->GetSsdLifeLeft() << "%\n";
                std::cout << "Total Bytes Written: " << drive->GetTotalBytesWritten() << "\n";
                std::cout << "Total Bytes Read: " << drive->GetTotalBytesRead() << "\n";
                std::cout << "Wear Leveling Count: " << drive->GetWearLevelingCount() << "\n";
            }

            std::cout << "-------------------------------------\n";
        }
    } catch (const std::exception& e) {
        std::cerr << "Error reading SMART data: " << e.what() << std::endl;
    }
}
info.hpp (C++) - Linux Only
#include "info.hpp"
#include <iostream>
using namespace LinuxInfo;

int main() {
    // Get CPU information
    auto cpuInfo = getCPUInfo();

    std::cout << "=== CPU Info ===\n";
    for (const auto& [key, value] : cpuInfo) {
        std::cout << key << ": " << value << "\n";
    }

    return 0;
}

πŸ“– Documentation

Full documentation is available on the GitHub Pages website:

πŸ“ Documentation Files

All documentation is in the docs/ folder:

  • What.md: API Reference & Output Examples
    Full explanation of every function, what info it returns, how to use it from Python, and real output samples.
  • INSTALL.md: Installation Guide
    Supported platforms, installation methods, and troubleshooting tips.
  • FAQ.md: Frequently Asked Questions
    Solutions to common installation, usage, and troubleshooting issues.
  • LiveViewAPI.md: LiveView API Reference
    Detailed explanation of the LiveView module API, including functions, usage, and examples.
  • LiveViewErrors.md: LiveView Errors & Exceptions
    Guides and examples for handling errors and exceptions in the LiveView module.

πŸ“š API Reference (Python)

HardView Functions
Function (JSON) Function (Python Object) Description
get_bios_info() get_bios_info_objects() BIOS vendor, version, release date
get_system_info() get_system_info_objects() System manufacturer, product name, UUID
get_baseboard_info() get_baseboard_info_objects() Motherboard info
get_chassis_info() get_chassis_info_objects() Chassis/computer case info
get_cpu_info() (Windows Only) get_cpu_info_objects() (Windows Only) Processor details
get_ram_info() get_ram_info_objects() Memory modules and totals
get_gpu_info() (Windows Only) get_gpu_info_objects() (Windows Only) GPU information
get_disk_info() get_disk_info_objects() Storage devices
get_network_info() get_network_info_objects() Network adapters
get_partitions_info() get_partitions_info_objects() Disk partitions (advanced)
get_cpu_usage() get_cpu_usage_objects() Current CPU usage
get_ram_usage() get_ram_usage_objects() Current RAM usage
get_system_performance() get_system_performance_objects() Combined CPU/RAM usage
monitor_cpu_usage_duration(d, i) monitor_cpu_usage_duration_objects(d,i) Monitor CPU usage over time
monitor_ram_usage_duration(d, i) monitor_ram_usage_duration_objects(d,i) Monitor RAM usage over time
monitor_system_performance_duration(d,i) monitor_system_performance_duration_objects(d,i) Monitor system performance over time
LiveView Classes & Methods
Class.Method Aliases Description
PyLiveCPU.get_usage(interval_ms) --- Get total CPU usage % over a given interval.
PyLiveCPU.cpuid() cpu_id() Get CPU details via CPUID instruction.
PyLiveCPU.CpuSnapShot(...) (Windows) cpu_snapshot(...) Get raw CPU time counters for a specific core or number of cores.
PyLiveRam.get_usage(Raw=False) --- Get total RAM usage % or raw [used_bytes, total_bytes].
PyLiveDisk(mode) --- Create disk monitor (mode=0 % usage [Windows], mode=1 R/W MB/s).
PyLiveDisk.get_usage(interval) --- Get disk usage as % or {Read MB/s, Write MB/s}.
PyLiveDisk.HighDiskUsage(...) high_disk_usage(...) Check if disk R/W exceeds threshold.
PyLiveNetwork.get_usage(interval, mode=0) --- Get total MB/s (mode 0) or per-interface MB/s (mode 1).
PyLiveNetwork.getHighCard() get_high_card() Get name of network adapter with highest usage.
PyLiveGpu.get_usage(interval_ms) (Windows) --- Get total GPU usage %.
PyLiveGpu.get_average_usage(interval_ms) (Windows) --- Get average GPU usage %.
PyLiveGpu.get_max_usage(interval_ms) (Windows) --- Get maximum GPU usage %.
PyLiveGpu.get_counter_count() (Windows) --- Get number of GPU counters monitored.
PyTempCpu.get_temp() (Windows) --- Get current CPU temperature.
PyTempCpu.get_max_temp() (Windows) --- Get max CPU core temperature.
PyTempCpu.get_avg_temp() (Windows) --- Get average CPU core temperature.
PyTempCpu.get_fan_rpm() (Windows) --- Get CPU fan RPM.
PyTempCpu.update() --- Refresh CPU temperature & fan RPM.
PyTempCpu.reget() re_get() Re-read CPU temperature & fan RPM.
PyTempGpu.get_temp() (Windows) --- Get current GPU temperature.
PyTempGpu.get_fan_rpm() (Windows) --- Get GPU fan RPM.
PyTempGpu.update() --- Refresh GPU temperature and fan RPM.
PyTempGpu.reget() re_get() Re-read GPU temperature and fan RPM.
PyTempOther.get_mb_temp() (Windows) --- Get motherboard temperature.
PyTempOther.get_Storage_temp() (Windows) get_storage_temp() Get storage temperature.
PyTempOther.update() --- Refresh other temperatures.
PyTempOther.reget() re_get() Re-read other temperatures.
PySensor.GetData(init=False) (Windows) get_data(init=False) Fetch sensors & fan data.
PySensor.GetValueByName(name) (Windows) get_value_by_name(name) Get sensor value by name.
PySensor.getAllSensors() (Windows) get_all_sensors() List all sensor names.
PySensor.getAllFanRPMs() (Windows) get_all_fan_rpms() List all fan RPM readings.
PySensor.update() --- Refresh sensors & fans data.
PySensor.reget() re_get() Re-fetch sensors & fans data.
PyManageTemp.Init() (Windows) init() Initialize temperature monitoring.
PyManageTemp.Close() (Windows) close() Shutdown temperature monitoring.
PyManageTemp.Update() (Windows) update() Update all temperature data.
PyRawInfo.RSMB() (Windows) rsmb() Get raw SMBIOS table bytes.
PyLinuxSensor.getCpuTemp() (Linux) get_cpu_temp() Get CPU temperature.
PyLinuxSensor.getChipsetTemp() (Linux) get_chipset_temp() Get chipset temperature.
PyLinuxSensor.getMotherboardTemp() (Linux) get_motherboard_temp() Get motherboard temperature.
PyLinuxSensor.getVRMTemp() (Linux) get_vrm_temp() Get VRM/memory temperature.
PyLinuxSensor.getDriveTemp() (Linux) get_drive_temp() Get storage temperature.
PyLinuxSensor.getAllSensorNames() (Linux) get_all_sensor_names() List all sensor names.
PyLinuxSensor.findSensorName(name) (Linux) find_sensor_name(name) Search for a sensor name.
PyLinuxSensor.GetSensorTemp(name, Match) (Linux) get_sensor_temp(name, Match) Get sensor temperature by name.
PyLinuxSensor.GetSensorsWithTemp() (Linux) get_sensors_with_temp() Get all sensors with their temperatures.
PyLinuxSensor.update(names=False) (Linux) --- Refresh sensor readings.
SMART Module (3.3.0+)

Main Classes

Class Properties Description
SmartReader is_valid, drive_path, revision_number, valid_attributes, raw_data Main SMART data reader for physical drives
SmartAttribute id, flags, current, worst, raw_value, name Individual SMART attribute data
SmartValues revision_number, offline_data_collection_status, self_test_execution_status, total_time_to_complete_offline_data_collection SMART values structure

SmartReader Methods

Method Parameters Description
SmartReader(drive_number) drive_number: int Create SMART reader for physical drive number (0, 1, 2, ...)
SmartReader(drive_path) drive_path: str Create SMART reader for drive path (e.g., '\\\\.\\PhysicalDrive0')
refresh() --- Refresh SMART data from drive
find_attribute(attribute_id) attribute_id: int Find specific attribute by ID
get_temperature() --- Get drive temperature in Celsius (-1 if not available)
get_power_on_hours() --- Get power-on hours (0 if not available)
get_power_cycle_count() --- Get power cycle count (0 if not available)
get_reallocated_sectors_count() --- Get reallocated sectors count (0 if not available)
get_ssd_life_left() --- Get SSD life remaining percentage (-1 if not available)
get_total_bytes_written() --- Get total bytes written (SSD only, 0 if not available)
get_total_bytes_read() --- Get total bytes read (SSD only, 0 if not available)
get_wear_leveling_count() --- Get wear leveling count (SSD only, 0 if not available)
is_probably_ssd() --- Check if drive is likely an SSD
is_probably_hdd() --- Check if drive is likely an HDD
get_drive_type() --- Get drive type as string ('SSD', 'HDD', or 'Unknown')

Utility Functions

Function Parameters Returns Description
scan_all_drives(max_drives) max_drives: int = 8 ([SmartReader, ...], [(drive_num, error_msg), ...]) Scan all available drives and return tuple of readers list and errors list
SMBIOS Module

Main Classes

Class Properties Description
SMBIOSParser --- Main parser for SMBIOS firmware data
BIOSInfo vendor, version, release_date, major_release, minor_release, characteristics, rom_size BIOS vendor, version, release date, ROM size
SystemInfo manufacturer, product_name, version, serial_number, uuid, sku_number, family, wake_up_type System manufacturer, product, UUID, serial number
BaseboardInfo manufacturer, product, version, serial_number, asset_tag, feature_flags, board_type Motherboard manufacturer, product, version
SystemEnclosureInfo manufacturer, version, serial_number, asset_tag, chassis_type, bootup_state, power_supply_state, thermal_state, security_status, height Chassis type, thermal state, security status
ProcessorInfo socket_designation, manufacturer, version, serial_number, asset_tag, part_number, processor_type, processor_family, processor_id, max_speed, current_speed, core_count, thread_count, characteristics CPU details, cores, threads, speeds
MemoryInfo device_locator, bank_locator, manufacturer, serial_number, asset_tag, part_number, size_mb, speed, memory_type, form_factor, type_detail RAM module details, size, speed, type
CacheInfo socket_designation, cache_configuration, maximum_cache_size, installed_size, cache_speed, error_correction_type, system_cache_type, associativity CPU cache levels and sizes
PortConnectorInfo internal_reference_designator, external_reference_designator, internal_connector_type, external_connector_type, port_type Physical port connectors information
SystemSlotInfo slot_designation, slot_type, slot_data_bus_width, current_usage, slot_length, slot_id Expansion slots (PCIe, PCI, etc.)
PhysicalMemoryArrayInfo location, use, memory_error_correction, maximum_capacity, number_of_memory_devices Memory array capacity and configuration
PortableBatteryInfo location, manufacturer, manufacture_date, serial_number, device_name, device_chemistry, design_capacity, design_voltage Battery capacity, chemistry, voltage
TemperatureProbeInfo description, location_and_status, maximum_value, minimum_value, nominal_value Temperature sensor information
VoltageProbeInfo description, location_and_status, maximum_value, minimum_value, nominal_value Voltage probe information
CoolingDeviceInfo description, device_type_and_status, nominal_speed Cooling device and fan information
SMBIOSInfo major_version, minor_version, bios, system, baseboard, system_enclosure, physical_memory_array, processors[], memory_devices[], caches[], port_connectors[], system_slots[], batteries[], temperature_probes[], voltage_probes[], cooling_devices[], oem_strings[] Complete SMBIOS information container

SMBIOSParser Methods

Method Parameters Description
load_smbios_data() --- Load SMBIOS data from system firmware
parse_smbios_data() --- Parse the loaded SMBIOS data
get_parsed_info() --- Get parsed SMBIOS information (returns SMBIOSInfo)
get_memory_type_string(type) type: int Convert memory type code to string (DDR4, DDR5, etc.)
get_form_factor_string(factor) factor: int Convert form factor code to string (DIMM, SODIMM, etc.)
get_processor_type_string(type) type: int Convert processor type code to string
get_chassis_type_string(type) type: int Convert chassis type code to string (Desktop, Laptop, etc.)
get_slot_type_string(type) type: int Convert slot type code to string (PCIe, PCI, etc.)
get_connector_type_string(type) type: int Convert connector type code to string
get_port_type_string(type) type: int Convert port type code to string (USB, HDMI, etc.)
get_cache_type_string(type) type: int Convert cache type code to string (L1, L2, L3, etc.)
get_battery_chemistry_string(chem) chem: int Convert battery chemistry code to string
get_last_error_as_string() (static) --- Get last Windows error as string

Convenience Functions

Function Returns Description
parse_smbios() (SMBIOSParser, SMBIOSInfo) Quick function to parse SMBIOS and return parser and info tuple
get_system_info() SMBIOSInfo Quick function to get complete SMBIOS system information

πŸ“Š Sensor Value Fetch Flow (LiveView)

classDiagram
    class LiveView {
        Request To Read
    }

    %% Linux path
    class LinuxPath {
        Search sensor name in lm-sensors
        If found β†’ return value
        If not found β†’ return -1
    }

    %% Windows path
    class WindowsPath {
        Check if monitoring library is initialized
        If initialized β†’ ask HardwareWrapper
    }

    class HardwareWrapper {
        Forward request to LibreHardwareMonitorlib
        If value available β†’ return value
        If not available β†’ return -1
    }

    %% Relations
    LiveView --> LinuxPath : "Linux"
    LiveView --> WindowsPath : "Windows"
    WindowsPath --> HardwareWrapper
Loading

Platform Support

Feature Windows Linux
BIOS Info βœ… yes βœ… yes
System Info βœ… yes βœ… yes
Baseboard Info βœ… yes βœ… yes
Chassis Info βœ… yes βœ… yes
CPU Info βœ… yes βœ… yes (by LiveView)
RAM Info βœ… yes βœ… yes
Disks βœ… yes βœ… yes
Network βœ… yes βœ… yes
Advanced Storage / SMART βœ… yes ❌ No
Performance Monitoring βœ… yes βœ… yes
Sensors βœ… yes (by LiveView) βœ… yes (by LiveView)

πŸ› οΈ Development

Build Instructions

Windows

python setup.py build_ext --inplace

Linux

python setup.py build_ext --inplace

πŸ“„ License

Core Project (HardView)

All core project files, including project-specific libraries and header files are licensed under the MIT License. They are free for both personal and commercial use.

Tools Folder

All tools in the Tools folder are licensed under: GNU GENERAL PUBLIC LICENSE (GPL-3).
You can read the full license terms in the file: LICENSE.GPL3.


πŸ§ͺ Quick Start And Tests

LiveView Tests

The LiveView test files are located in tests/units


🀝 Contribution

Contributions are welcome!

πŸ”€ Fork & Pull Requests

Fork the repository and submit pull requests with your improvements

πŸ› Issues & Features

Report issues or request features through GitHub Issues


🌟 HardView β€” Your Window into Hardware Information

See HardView API for the full HardView API
See LiveView API for the full LiveView API


Made with ❀️ for hardware enthusiasts and developers