Best-effort host specification capture for environment comparison, troubleshooting, and LLM context.
Project description
hostxray
hostxray collects a best-effort, privacy-aware machine specification for environment comparison (dev/uat/prod), troubleshooting, and providing LLM context.
- Standard library first
- Optional enrichment via extras (
pip install hostxray[full]) - Best-effort collection with graceful degradation (never crash)
- Deterministic, JSON-serializable output
- Safe mode (default) redacts sensitive identifiers
This README is intentionally self-contained for PyPI. The docs/ folder (on GitHub) has deeper, field-by-field guidance, but you shouldn’t need it to get started.
Install
pip install hostxray
# Optional extras
pip install hostxray[full]
Quickstart (CLI)
Collect a standard, safe-by-default spec as JSON:
hostxray --format json --profile standard
Collect a more complete spec (may include identifying values):
hostxray --format json --profile full --unsafe
Targeted redaction (even in unsafe mode):
hostxray --format json --profile full --unsafe --redact hostname mac ip user serial
Quickstart (Python)
from hostxray import collect_spec
spec = collect_spec(profile="standard")
print(spec.to_json(indent=2))
Key concepts (quick reference)
Profiles
Profiles control what to attempt to collect.
standard: solid baseline for environment comparison (OS, hardware summary, Python, basic network shape)full: attempts additional enrichment when available (more detailed hardware/network/process-level data)
If a data source is unavailable (missing permissions, missing optional dependency, unsupported platform), hostxray skips it and continues.
Safe mode vs unsafe
By default, hostxray runs in safe mode and redacts common identifiers.
- Safe mode (default): returns a useful spec while redacting sensitive identifiers
- Unsafe mode (
--unsafe/ API option): may include identifying values like hostname, usernames, MAC addresses, IPs, serials (depending on platform and availability)
Redaction controls
You can explicitly redact categories:
hostnameuseripmacserial
(Exact available categories may evolve; the CLI --help is the source of truth for your installed version.)
Output guarantees
- JSON-serializable, deterministic structure
- Designed to be stable for diffing across machines
- Collection is best-effort; missing fields are expected and normal
Extras (optional enrichment)
hostxray works with the standard library alone. Installing extras enables additional collectors.
pip install hostxray[full]
If you’re distributing this in a locked-down environment, you can stay on the base install and still get a useful baseline.
CLI
hostxray --help
Documentation
If you’re viewing this on GitHub, deeper references are available:
- docs/README.md: field-by-field guidance and sources
- docs/USAGE.md: CLI and API usage
- docs/EXTRAS.md: what
hostxray[full]improves
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hostxray-0.0.0.tar.gz.
File metadata
- Download URL: hostxray-0.0.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cfb072c2a1a0fa43f259fd768909a06789dc7f3bb645e7c00dbac21300e3e81
|
|
| MD5 |
eb4bd75d9ace3187e296b5a45e3d0d8d
|
|
| BLAKE2b-256 |
1d3a28ac5cf061ebfd4b378475897a5459a0a32bd1344a045fd00d7c6249419b
|
File details
Details for the file hostxray-0.0.0-py3-none-any.whl.
File metadata
- Download URL: hostxray-0.0.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f01d9ec54909889bfec8b44c8890916be1de8a4e1b6f9153039419baa38f16
|
|
| MD5 |
ac4b0ebb489a390e761cec668f7752c5
|
|
| BLAKE2b-256 |
8ea1aebbcbac655a2800cb11f91cbd5615b68118336e6948824bf959d1ff3386
|