Installation and Quick Example
Install the package from PyPI:
pip install erbsland-ansi-convert
Use the Terminal API to parse ANSI output and export it as text, ANSI, or HTML:
from erbsland.ansi_convert import Terminal
terminal = Terminal(width=120, height=40, back_buffer_height=2000)
terminal.write("\x1b[31mHello\x1b[0m")
plain_text = terminal.to_text()
ansi_text = terminal.to_ansi()
html_output = terminal.to_html(class_prefix="my-ansi")