libvt

Pure-Python, zero-dependency, typed virtual terminal emulator and streaming VT parser (py3-none-any.whl — no C shared library required).

Quickstart

Render VT streams, inspect cells, and write boxed screen assertions.

Quickstart
Topics

Sans-I/O layering, RLE scrollback, ?2026 stepping, OSC 7501, and input encoding.

Topics
API Reference

Public modules, dataclasses, protocols, and vt_* pytest fixtures.

API Reference
Project & ADRs

Contributing, code style, releases, and Architecture Decision Records 0001–0010.

Project

Install

$ uv add libvt
$ pip install libvt

libvt is pre-1.0; pin a minor range (libvt>=0.1,<0.2).

At a glance

>>> import libvt
>>> term = libvt.Terminal(rows=4, cols=20)
>>> term.feed(b"\x1b[1;31mhello\x1b[0m \xe6\x97\xa5\xe6\x9c\xac")
>>> term.text
'hello 日本'
>>> term[0, 0].style.fg
<AnsiColor.RED: 1>
>>> term.cursor.row, term.cursor.col
(0, 10)