API reference
python:astx:astx.viz.visualize_ascii
function visualize_ascii
visualize_ascii(ast: ReprStruct, timeout: int = 10, direction: Direction = 'TD', width: Optional[int] = None, border_padding: Optional[int] = 0, padding_x: Optional[int] = 3, padding_y: Optional[int] = 3, ascii_only: bool = False) -> str
Source: packages/astx/src/astx/viz.py:216
Render the AST to ASCII using the mermaid-ascii CLI.
For maximum compatibility, this uses an ASCII-friendly Mermaid form:
- no named items (node text is the identifier)
- pipe-labeled edges (--> |label| ...)
Parameters
-
ast — Type: ReprStruct
-
timeout — Type: int
-
direction — Type: Direction
-
width — Type: Optional[int]
-
border_padding — Type: Optional[int]
-
padding_x — Type: Optional[int]
-
padding_y — Type: Optional[int]
-
ascii_only — Type: bool
Returns
Type: str