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:203
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 — AST.; Type: ReprStruct
-
timeout — Time limit for the operation.; Type: int
-
direction — Direction.; Type: Direction
-
width — Bit width or display width.; Type: Optional[int]
-
border_padding — Border padding.; Type: Optional[int]
-
padding_x — Padding x.; Type: Optional[int]
-
padding_y — Padding y.; Type: Optional[int]
-
ascii_only — Whether to use ascii only.; Type: bool
Returns
Result of this operation: render the AST to ASCII using the mermaid-ascii CLI.; Type: str