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.

Known Issues

  • tzlocal is pinned to 5.4 and 5.4.1 and 5.4.2 broke the package.

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.2 (2026-06-16)

  • CHANGED: tzlocal is pinned to 5.4 and 5.4.1 and 5.4.2 broke the package.

0.3.1 (2026-06-12)

  • ADDED: Added IANA timezone value to get_datetime_info

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.2.tar.gz (103.8 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.2-py3-none-any.whl (72.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: host_inspector-0.3.2.tar.gz
  • Upload date:
  • Size: 103.8 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.2.tar.gz
Algorithm Hash digest
SHA256 acfe49f289fba06cea6e883149fb5cbb975c7a7ae811745e0e2b3732b44d08d2
MD5 58e0b1c1c5ecccad303c02bd7fbf3080
BLAKE2b-256 2b24f64ae744e6b7693be080c4b0217d02b358232d0afe9a6cbafa13f847044b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: host_inspector-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 72.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f437fc44aa6423a373fbbedd2fa548f39ab2546d7c8ceb5796e25a521dfa5785
MD5 56e18cfa612d5ba952d9fda4f82b64ca
BLAKE2b-256 04110e52507acbf8eb1d146761602619e657eeb9fb7463aae08f0c8928418819

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