Skip to main content

A simple python package to gather host information from Windows, Mac and Linux. Returns host data as dicts to be used internally or sent to front-end dashboard applications as JSON.

Project description

Host Inspector

Coverage

A Python package to collect host/system information on macOS, Linux, and Windows.

Installation

uv add host-inspector
# or
python3 -m pip install host-inspector

Development Setup

just pip-install-editable

Testing and Checks

just ruff-check
just pytest
just api-check

List all available project commands:

just

Public API

Top-level imports from host_inspector:

from host_inspector import get_cpu_info
from host_inspector import get_datetime_info
from host_inspector import get_device_info
from host_inspector import get_disk_info
from host_inspector import get_display_info
from host_inspector import get_firewall_info
from host_inspector import get_gpu_info
from host_inspector import get_health_info
from host_inspector import get_mem_info
from host_inspector import get_network_info
from host_inspector import get_os_info
from host_inspector import get_platform_info
from host_inspector import get_uptime_info

Additional module APIs:

from host_inspector.firewall import get_firewall_info
from host_inspector.python import get_python_info

Example:

from host_inspector import get_device_info, get_health_info
from host_inspector.python import get_python_info

print(get_device_info())
print(get_health_info())
print(get_python_info())

Security Notes

Some firewall and hardware details may require elevated permissions depending on OS configuration.

Linux (optional sudoers setup)

If your deployment requires passwordless access for specific probes, use sudo visudo and add only what you need, for example:

%sudo ALL=(ALL) NOPASSWD: /usr/sbin/ufw
%sudo ALL=(ALL) NOPASSWD: /usr/sbin/dmidecode

Apply the minimum required permissions for your environment.

Issues

Report issues at: https://bitbucket.org/xstudios/host-inspector/issues


History

All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

0.3.0 (2026-04-20)

  • CHANGED: Migrated packaging/build backend to hatchling with xapp-tools.
  • CHANGED: Updated supported Python baseline to >=3.11.
  • CHANGED: Removed legacy setuptools packaging artifacts and build helper scripts.
  • CHANGED: Updated public API contract to focus on module-level exports.
  • CHANGED: Memory reporting now aligns with OS expectations by deriving used from total - available and reporting physical RAM with binary sizing.
  • CHANGED: CPU usage reporting now uses sampled aggregate idle-time semantics for closer alignment with OS-reported utilization on macOS, Linux, and Windows.

0.2.5 (2026-03-13)

  • CHANGED: Completed layered (domain/application/infrastructure) refactors across host info domains.
  • CHANGED: Replaced dict-style application port payloads with dataclass DTO contracts where structured payloads cross boundaries.
  • CHANGED: Updated README workflow docs to use just commands for setup/check/test tasks.

0.2.4 (2025-11-21)

  • CHANGED: Firewall rule enabled will always be a boolean rather than YES/NO on Windows for consistency.
  • ADDED: Added tox and tox-uv for testing against multiple versions of python

0.2.3 (2025-10-07)

  • CHANGED: Ensure tests pass on Ubuntu (not all data available - yet)

0.2.2 (2025-09-25)

  • CHANGED: Standardize date/time formatting for device uptime and local_datetime

0.2.1 (2025-09-23)

  • ADDED: Support for getting Linux Firewall status and rules using ufw.

0.2.0 (2025-09-09)

  • CHANGED: get_device_info now returns a displays key which is a list of connected displays
  • CHANGED: get_gpu_info now returns a list of dicts (one for each GPU)
  • ADDED: get_display_info returns a list of dicts (one for each display)
  • CHANGED: For backawards compatability, when calling get_device_info, the gpu key will be an object if only one GPU detected.

0.1.1 (2025-09-04)

  • ADDED: Support for getting Windows Firewall status and rules

0.1.0 (2025-08-06)

  • First release

Project details


Download files

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

Source Distribution

host_inspector-0.3.0.tar.gz (103.4 kB view details)

Uploaded Source

Built Distribution

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

host_inspector-0.3.0-py3-none-any.whl (72.6 kB view details)

Uploaded Python 3

File details

Details for the file host_inspector-0.3.0.tar.gz.

File metadata

  • Download URL: host_inspector-0.3.0.tar.gz
  • Upload date:
  • Size: 103.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for host_inspector-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2518cdd509a650231e1fd5141537722a28a32e433ea7135e2c82b1e9617601f1
MD5 f1d64aa3ce7303ab0c8b70d64c5b80a9
BLAKE2b-256 73f7e640cfe4c67461f4d2069fa7d3080721bc0116491d238ce020211cffd09b

See more details on using hashes here.

File details

Details for the file host_inspector-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: host_inspector-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 72.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for host_inspector-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fb8fbdee36b56a665094167b9a3bc7709069ca0c2946ac67f6d902aedaa0511
MD5 09b370235a95a410b8574a6d259b4da7
BLAKE2b-256 6ea231fa770dfbc17a78c58a63b69cb2084a33f0b3834dffb137fe7e6741b268

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page