ANSI-Conversion via Terminal Emulation

erbsland-ansi-convert is a Python library that emulates ANSI terminal output and converts the resulting screen + history to plain text, ANSI text, or HTML.

Features

  • Simulates a configurable terminal screen and scroll-back history.

  • Parses common ANSI cursor, erase, style, and color sequences.

  • Exports compact plain text, ANSI text, or HTML outputs.

Quick Start

Installation

pip install erbsland-ansi-convert

Usage

from erbsland.ansi_convert import Terminal

terminal = Terminal()
terminal.write("\x1b[31mHello\x1b[0m")

terminal.to_text()
terminal.to_ansi()
terminal.to_html()

Contents

Indices and Tables