Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

SystemDetector

A cross-platform system and hardware information collector for Python. The package gathers data on the CPU, memory, disks, network, Bluetooth, firmware, GPU, battery, operating system, and Python version.

Project status: alpha (0.0.1). Data collection is performed to the best of its ability, and some fields may be None, 0, or empty lists when the system does not provide certain information.

Requirements

  • Python 3.9 or higher
  • psutil, installed automatically
  • Windows: the windows extra installs WMI for additional hardware queries

The package also uses native tools when available, such as PowerShell, bluetoothctl, lspci, system_profiler, pmset, and files from /sys and /proc on Linux. The absence of these tools does not prevent the package from being imported, but may reduce the amount of information collected.

Instalation

GitHub

pip install git+https://github.com/PlayGames-2020/SystemDetector.git

or

pip install git+https://github.com/PlayGames-2020/SystemDetector.git@main

Quick Start

from SystemDetector.detector import SystemDetector


detector = SystemDetector()

cpu = detector.get_cpu_info()
print(f"CPU: {cpu.Brand or 'Desconhecida'}")
print(f"Uso: {cpu.Usage:.1f}%")

memory = detector.get_memory_info()
print(f"RAM total: {memory.Total} bytes")

snapshot = detector.get_all_info
print(snapshot["OS"])

The class accepts an optional TTL for the internal cache:

from SystemDetector.detector import SystemDetector


detector = SystemDetector(ttl_seconds=10)
# Clears all values ​​stored in the cache when necessary.
detector.clear_cache()

Singleton access compatible with the legacy API is also available:

from SystemDetector.detector import ConfigSystemDetector


detector = ConfigSystemDetector()

Main API

All of the methods listed below return dataclasses defined in SystemDetector.metadata, except for methods that return lists or dictionaries.

Method Return Content
get_cpu_info() CPU Cores, frequency, usage, temperature, and brand
get_memory_info() Memory RAM and swap, in bytes
get_disk_info(path=“/”) Disk Space, file system, and disk type
get_all_disks() dict[str, Disk] Mounted partitions indexed by mount point
get_network_info() Network IP addresses, MAC addresses, interface, connectivity, and speed
get_bluetooth_info() BluetoothInfo Bluetooth adapters and devices
get_bios_info() BIOS Manufacturer, version, date, and serial number
get_motherboard_info() Motherboard Manufacturer, model, and serial number
get_gpu_info() list[GPU] Detected graphics drivers
get_battery_info() Battery Percentage, status, capacity, and cycles
get_system_info() SystemInfo Operating system, kernel, architecture, and uptime
get_all_info() dict[str, Any] Aggregated snapshot of all categories
clear_cache() None Removes cached values

The PascalCase names from the legacy API are still available, for example GetCPUInfo(), GetMemoryInfo(), GetAllDisks(), and GetAllInfo().

Snapshot Structure

get_all_info() returns a dictionary with these keys:

OS, CPU, Memory, Disks, Network, BIOS, Motherboard,
GPU, Battery, Bluetooth, Python

To convert a single dataclass into a dictionary:

cpu_dict = detector.get_cpu_info().as_dict()

The main metrics are:

  • CPU: frequency in MHz, usage and temperature in percentage and degrees Celsius
  • Memory and disks: bytes
  • GPU: memory in bytes when available
  • Battery: percentage from 0 to 100 and voltage in volts when available
  • Uptime: seconds since startup

Notes on networking and privacy

get_network_info() attempts to determine the local IP address via a UDP connection and checks Internet availability with a TCP connection to 8.8.8.8:53. This check may take a few seconds or fail on restricted networks.

The package does not send the collected data to an external service; the result is returned only to the code that calls the methods. Nevertheless, applications that expose or store the snapshot should treat fields such as serial numbers and network addresses as potentially sensitive data.

Development and Testing

The tests are located in tests/ and use mocks so they do not depend on actual hardware, system commands, or a network connection.

python -m unittest discover -s tests -v

If the development add-on is installed, you can also run:

python -m pytest

License

Distributed under the license MIT.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

systemdetector-0.0.1a0.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

systemdetector-0.0.1a0-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file systemdetector-0.0.1a0.tar.gz.

File metadata

  • Download URL: systemdetector-0.0.1a0.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for systemdetector-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 371c5f35828353eeee9ce6a2701406d5b05f3d0b0323b52c118b55d02cbaf630
MD5 2e0fc8e7e60a9bf4e79ec780b6484112
BLAKE2b-256 60ced9bfaf666807d75b72268338dc05681e1f37dcb5d8f03cf3d8c70a9d8988

See more details on using hashes here.

File details

Details for the file systemdetector-0.0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for systemdetector-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 14a7dd76a9fc44a72202d0f8d5785ff6aa14608b25f169537710449a12e078ae
MD5 d8bcbb2a3cb5006e1a4829c3a0902b58
BLAKE2b-256 170637a9fcba4521ebda0091e43406b49685e658330bb39b43a9ebeefe6ade7c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1a0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page