GraphViz Utilities#

GraphViz detection and utility functions for HBAT.

This module provides functionality to detect GraphViz installation, check available engines, and validate GraphViz executables on the system.

class hbat.utilities.graphviz_utils.GraphVizDetector[source]#

Bases: object

Detects and validates GraphViz installation.

This class provides static methods to check for GraphViz availability, version information, and available layout engines.

static is_graphviz_available() bool[source]#

Check if GraphViz executables are in PATH.

Returns:

True if GraphViz is available, False otherwise

Return type:

bool

static get_graphviz_version() str | None[source]#

Get installed GraphViz version.

Returns:

Version string if available, None otherwise

Return type:

Optional[str]

static get_available_engines() List[str][source]#

Get list of available GraphViz layout engines.

Returns:

List of available engine names

Return type:

List[str]

static validate_engine(engine: str) bool[source]#

Validate if a specific engine is available.

Parameters:

engine (str) – Engine name to validate (e.g., ‘dot’, ‘neato’)

Returns:

True if engine is available, False otherwise

Return type:

bool

static get_engine_path(engine: str) str | None[source]#

Get the full path to a GraphViz engine executable.

Parameters:

engine (str) – Engine name (e.g., ‘dot’, ‘neato’)

Returns:

Full path to executable if found, None otherwise

Return type:

Optional[str]

static clear_cache() None[source]#

Clear all cached detection results.

Useful for re-detecting after GraphViz installation/removal.

hbat.utilities.graphviz_utils.get_graphviz_info() Dict[str, any][source]#

Get comprehensive GraphViz installation information.

Returns:

Dictionary with GraphViz info

Return type:

Dict[str, any]