Metadata-Version: 2.4
Name: host-inspector
Version: 0.3.0
Summary: 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-URL: Repository, https://bitbucket.org/xstudios/host-inspector.git
Project-URL: Issues, https://bitbucket.org/xstudios/host-inspector/issues
Project-URL: Changelog, https://bitbucket.org/xstudios/host-inspector/src/master/HISTORY.md
Author-email: Tim Santor <tsantor@xstudios.com>
License-File: AUTHORS.md
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Requires-Dist: humanize>=4.14.0
Requires-Dist: psutil>=7.1.3
Requires-Dist: py-machineid>=0.8.1
Description-Content-Type: text/markdown

# Host Inspector

![Coverage](https://img.shields.io/badge/coverage-65.67%25-yellow)

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

## Installation

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

## Development Setup

```bash
just pip-install-editable
```

## Testing and Checks

```bash
just ruff-check
just pytest
just api-check
```

List all available project commands:

```bash
just
```

## Public API

Top-level imports from `host_inspector`:

```python
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:

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

Example:

```python
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:

```ini
%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](http://semver.org/).

## 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
