Skip to content

formatting

pyvider.hcl.output.formatting

CTY value formatting and pretty printing.

Classes

Functions

pretty_print_cty

pretty_print_cty(value: CtyValue[Any]) -> None

Pretty print a CTY value to stdout.

Parameters:

Name Type Description Default
value CtyValue[Any]

CTY value to print

required
Example

from pyvider.cty import CtyString val = CtyString().validate("test") pretty_print_cty(val) "test"

Source code in pyvider/hcl/output/formatting.py
def pretty_print_cty(value: CtyValue[Any]) -> None:
    """Pretty print a CTY value to stdout.

    Args:
        value: CTY value to print

    Example:
        >>> from pyvider.cty import CtyString
        >>> val = CtyString().validate("test")
        >>> pretty_print_cty(val)
        "test"
    """
    print(_pretty_print_cty_recursive(value, 0))