About | Features | Installation | Usage | API Reference | Platform Support | License
HardView is a cross-platform Python module that provides detailed hardware information in JSON format. It's written in C to ensure high performance and native access to system hardware details, making it compatible with both Windows and Linux systems.
This library goes beyond basic system information, offering deep insights into various hardware components through efficient C implementation, utilizing platform-specific APIs like WMI on Windows and sysfs/proc on Linux.
⚠ Important Note: Please ensure you use the correct casing, "HardView", when referring to the module to avoid any import or usage issues.
Install from PyPI (when available):
pip install HardView
Install directly from source:
You can clone the repository from GitHub or download the ZIP file:
# Clone the repository
git clone https://github.com/gafoo173/HardView/
# Or download the ZIP from https://github.com/gafoo173/HardView/archive/refs/heads/main.zip
# and extract it.
# Navigate into the HardView directory
cd HardView
# Install the module
pip install .
Important Note about Version: Please be aware that version 0.1.0 of the `HardView` library is the recommended stable release. Other versions might be unstable.
Renaming the .pyd/.so file (Optional for direct `import HardView`): When installing from source or a wheel, the generated module file (e.g., HardView-0.1.0-cp39-cp39-win_amd64.pyd
on Windows or HardView-0.1.0-cp39-cp39-manylinux1_x86_64.so
on Linux) will be placed directly inside your Python's site-packages
folder.
For the most straightforward import (import HardView
), you might need to manually rename this file to HardView.pyd
(or HardView.so
).
Alternatively, if you prefer not to rename the file, you can import the library directly using its full generated name. Simply replace hyphens (-
) with underscores (_
) in the filename and remove the file extension (.pyd
or .so
).
Here are example import statements for various versions if you **do not rename** the file:
# Windows (64-bit) Examples:
import HardView_0_1_0_cp38_cp38_win_amd64
import HardView_0_1_0_cp39_cp39_win_amd64
import HardView_0_1_0_cp310_cp310_win_amd64
import HardView_0_1_0_cp311_cp311_win_amd64
import HardView_0_1_0_cp312_cp312_win_amd64
import HardView_0_1_0_cp313_cp313_win_amd64
# Windows (32-bit) Examples:
import HardView_0_1_0_cp38_cp38_win32
import HardView_0_1_0_cp39_cp39_win32
import HardView_0_1_0_cp310_cp310_win32
import HardView_0_1_0_cp311_cp311_win32
import HardView_0_1_0_cp312_cp312_win32
import HardView_0_1_0_cp313_cp313_win32
# Linux (manylinux1_x86_64) Examples:
import HardView_0_1_0_cp38_cp38_manylinux1_x86_64_manylinux_2_28_x86_64_manylinux_2_5_x86_64
import HardView_0_1_0_cp39_cp39_manylinux1_x86_64_manylinux_2_28_x86_64_manylinux_2_5_x86_64
import HardView_0_1_0_cp310_cp310_manylinux1_x86_64_manylinux_2_28_x86_64_manylinux_2_5_x86_64
import HardView_0_1_0_cp311_cp311_manylinux1_x86_64_manylinux_2_28_x86_64_manylinux_2_5_x86_64
import HardView_0_1_0_cp312_cp312_manylinux1_x86_64_manylinux_2_28_x86_64_manylinux_2_5_x86_64
import HardView_0_1_0_cp313_cp313_manylinux1_x86_64_manylinux_2_28_x86_64_manylinux_2_5_x86_64
# Linux (musllinux_1_2_x86_64) Examples:
import HardView_0_1_0_cp38_cp38_musllinux_1_2_x86_64
import HardView_0_1_0_cp39_cp39_musllinux_1_2_x86_64
import HardView_0_1_0_cp310_cp310_musllinux_1_2_x86_64
import HardView_0_1_0_cp311_cp311_musllinux_1_2_x86_64
import HardView_0_1_0_cp312_cp312_musllinux_1_2_x86_64
import HardView_0_1_0_cp313_cp313_musllinux_1_2_x86_64
# macOS (Apple Silicon/ARM64) Examples:
import HardView_0_1_0_cp38_cp38_macosx_11_0_arm64
import HardView_0_1_0_cp39_cp39_macosx_11_0_arm64
import HardView_0_1_0_cp310_cp310_macosx_11_0_arm64
import HardView_0_1_0_cp311_cp311_macosx_11_0_arm64
import HardView_0_1_0_cp312_cp312_macosx_11_0_arm64
import HardView_0_1_0_cp313_cp313_macosx_11_0_arm64
How to find your site-packages folder: You can find the path to your site-packages
folder using the following commands in your command prompt/terminal:
# For Windows
python -c "import site; print(site.getsitepackages())"
# For Linux/macOS
python3 -c "import site; print(site.getsitepackages())"
Importing after Installation: If you have renamed the file to `HardView.pyd` (or `HardView.so`), you can simply import and use the library:
import HardView
# You can now use all HardView functions, e.g.
print(HardView.get_system_info())
If you imported using the full name, remember to use that name when calling functions, or use an `as` alias:
import HardView_0_1_0_cp311_win_amd64 # Example full import
# Then call functions using the full name:
print(HardView_0_1_0_cp311_win_amd64.get_system_info())
# Or use an alias for convenience:
import HardView_0_1_0_cp311_win_amd64 as hv
print(hv.get_system_info())
Here's a quick example of how to use the HardView module:
import HardView
import json
import pprint
# Get all hardware information
bios_info = json.loads(HardView.get_bios_info())
system_info = json.loads(HardView.get_system_info())
cpu_info = json.loads(HardView.get_cpu_info())
ram_info = json.loads(HardView.get_ram_info())
disk_info = json.loads(HardView.get_disk_info())
network_info = json.loads(HardView.get_network_info())
# Pretty print CPU information
pprint.pprint(cpu_info)
HardView exposes the following core functions to retrieve hardware information:
Function | Description |
---|---|
get_bios_info() | Retrieves BIOS manufacturer, version, and release date. |
get_system_info() | Gets system manufacturer, product name, UUID, and serial number. |
get_baseboard_info() | Fetches motherboard (baseboard) manufacturer, product, serial number, and version. |
get_chassis_info() | Obtains information about the computer's chassis, including manufacturer, type, serial number, and version. |
get_cpu_info() | Provides details about the CPU, such as name, manufacturer, number of cores, logical processors, max clock speed, and processor ID. |
get_ram_info() | Gathers Random Access Memory (RAM) information, including total physical memory and details for individual memory modules (capacity, speed, manufacturer, serial number, part number). |
get_disk_info() | Retrieves information about storage devices (disk drives), including model, serial number, size, media type, and interface type. |
get_network_info() | Collects data on network adapters, such as description, MAC address, IP addresses (IPv4 and IPv6), and DNS host name. |
Feature | Windows | Linux |
---|---|---|
BIOS Info | โ WMI | โ sysfs |
System Info | โ WMI | โ sysfs |
Baseboard | โ WMI | โ sysfs |
Chassis | โ WMI | โ sysfs |
CPU | โ WMI | โ /proc/cpuinfo |
RAM | โ WMI | โ /proc/meminfo |
Disks | โ WMI | โ /sys/block |
Network | โ WMI | โ getifaddrs |
HardView is primarily designed to be installed from PyPI or built from source.
Currently, direct pre-built binary downloads (wheels) are not provided here. Please refer to the Installation section for instructions on how to install via pip or build from the source code.
MIT License โ Free for personal, academic, and commercial use.