Pyte is a simple, VTXXX-compatible terminal emulator library for Python. It processes ANSI escape sequences and maintains the state of a terminal screen, allowing programmatic interaction with terminal output without a GUI. The current version is 0.8.2, and it has a moderate release cadence, with updates typically for bug fixes and minor features.
pip install pyteVerified import paths — ran on the pinned version, not inferred.
Initializes a `pyte.Screen` and `pyte.Stream`, feeds some basic ANSI-encoded text, and then prints the current state of the screen to standard output, including cursor position and mode.
Update `Screen` instantiation: `Screen(columns=80, rows=24)` instead of `Screen(cols=80, rows=24)`.
Ensure all input to `feed()` is encoded to bytes, for example, `stream.feed(b'some text')` or `stream.feed('some text'.encode('utf-8'))`.Validate input sequences if possible, or be prepared to handle non-standard behavior by resetting the screen or carefully processing known sequence subsets.
Encode the string to bytes before feeding, e.g., `stream.feed('text'.encode())` or use a bytes literal `stream.feed(b'text')`.Change `cols` to `columns` in the `Screen` constructor, e.g., `pyte.Screen(columns=80, rows=24)`.
Access cursor attributes via the `cursor` object: `screen.cursor.x`, `screen.cursor.y`.
No dependency data recorded yet.