Modules#
An overview of the modules that make up hwid.
The API reference below is generated automatically from the source docstrings.
Public API (hwid.core)#
The package exposes hwid.get_hwid() at the top level.
Core engine for HWID: resolution logic, per-OS backends, errors, logging.
- hwid.core.get_hwid()[source]#
Get the hardware ID of the current machine.
- Returns:
The hardware ID string.
- Return type:
- Raises:
UnsupportedOSError – If the operating system is not supported.
InvalidHWIDError – If the retrieved hardware ID is invalid.
Exceptions (hwid.core.exceptions)#
Exceptions for the HWID package.
Logging (hwid.core.logging_setup)#
Set up logging for the project.
This module configures logging for the project, ensuring that log handlers are only added once to prevent duplicate log entries if the module is imported multiple times.
Setup is resilient to a read-only or unavailable $HOME: if the log
directory cannot be created it degrades to console-only logging instead of
raising, so read-only commands (--help, version) stay usable.
- hwid.core.logging_setup.get_logger()[source]#
Return the cached project logger.
- Returns:
The cached project logger.
- Return type:
CLI (hwid.cli)#
argparse command-line interface exposing version and info commands.
CLI application for the project.
A dependency-free argparse root for the hwid command. It
exposes the same version / info commands as the Typer variant and hangs
every enabled non-primary component off the root as a lazily-imported subcommand
— hwid interactive (TUI), hwid web, … —
rather than a separate hwid-<name> console script (see
ADR-019 and ADR-020). Selected via cli_framework.
- hwid.cli.app.info()[source]#
Display information about the hwid application.
- Show application information:
hwid info
- Example output:
Application Version: 0.1.0 Python Version: 3.12.0 (CPython) Platform: Darwin
- Raises:
SystemExit – With code 1 if the package metadata cannot be found.
- Return type:
None
- hwid.cli.app.show_version()[source]#
Show the current version number of hwid.
- Show the version number:
hwid version
- Example output:
0.1.0
- Raises:
SystemExit – With code 1 if the package metadata cannot be found.
- Return type:
None