This release is a pre-release and may not be stable for production use.
libvt
libvt (pip install libvt, import libvt) is a pure-Python,
zero-dependency, typed virtual terminal emulator and streaming VT parser
(py3-none-any.whl — no C shared library required).
Highlights
- Sans-I/O core: Zero runtime dependencies, zero I/O on
import libvt, and noasyncio,pty, orpytestimports until requested. - Compact two-tier grid: Lazy 64-bit inline viewport attributes plus run-length-encoded scrollback rows and primary-screen soft-wrap resize reflow.
- Unicode 17 clustering: Bundled two-stage width and UAX #29 tables
handling CJK wide glyphs, ZWJ emoji, Regional Indicator flag pairs,
Indic conjuncts, and
VS15/VS16under DEC?2027. - Modern terminal protocols: Rex
OSC 7501Program Status (withOSC 9;4fallback),OSC 133semantic prompt zones,OSC 7working directory,OSC 8hyperlinks,OSC 52clipboard,?2026synchronized-output stepping,DECRQM,DECRQSS,XTGETTCAP, andDCS tmux;passthrough events. - Mode-aware input & testing: Outbound key/mouse/focus/paste
encoding (including Kitty
CSI uand fail-closed bracketed paste),libvt.aiostream and controlling-TTY POSIX PTY helpers,vt_*pytest fixtures, andassert_screen/assert_screen_boxdiffs withFlightRecorderdisassembly.
Requirements
- Python >= 3.12 (CPython and PyPy)
- Zero runtime dependencies
Installation
Install with uv:
$ uv add libvt
Install with pip:
$ pip install libvt
libvt is pre-1.0; pin a minor range in downstream projects
(libvt>=0.1,<0.2).
Quickstart
One-liner helpers render, strip, or disassemble VT byte streams without managing an emulator instance:
>>> import libvt
>>> libvt.render(b"\x1b[1;32mready\x1b[0m\r\nitem 1", rows=4, cols=20)
'ready\nitem 1'
>>> libvt.strip(b"\x1b[31merror:\x1b[0m failed")
'error: failed'
Stateful emulation tracks zero-based (row, col) cells, SGR colon
subparameters, query replies, and OSC 7501 program status:
>>> term = libvt.Terminal(rows=4, cols=20)
>>> term.feed(b"\x1b[1;4:3;38:2::40:180:160mstatus\x1b[0m\x1b[6n")
>>> term[0, 0].style.underline
<UnderlineStyle.CURLY: 3>
>>> term.drain_replies()
b'\x1b[1;7R'
>>> term.feed(b"\x1b]7501;state=working:id=build:progress=60\x1b\\")
>>> term.program_status.value, term.program_status.progress
('working', 60)
Boxed visual assertions verify CJK wide-character alignment and cursor coordinates in tests:
>>> from libvt.testing import assert_screen_box
>>> t = libvt.Terminal(rows=2, cols=8)
>>> t.feed("日本ok\r\ndone".encode())
>>> assert_screen_box(
... t,
... """
... ┌────────┐
... │日本ok │
... │done │
... └────────┘
... """,
... cursor=(1, 4),
... )
License
MIT License. See LICENSE.
Metadata
Release files for libvt 0.0.1a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libvt-0.0.1a0.tar.gz | 198.5 kB | With provenance | Details for libvt-0.0.1a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| libvt-0.0.1a0-py3-none-any.whl | Python 3 | none | any | Details for libvt-0.0.1a0-py3-none-any.whl |
Total release size: 330.7 kB
Release files / libvt-0.0.1a0.tar.gz
| Download URL | libvt-0.0.1a0.tar.gz |
|---|---|
| Size | 198.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e176930d8cb95bf8160a753f1a73eef26f0829f73b71f2a39e64eac44645b78
|
|
BLAKE2b-256 checksum How to use checksums |
0df08b845180278110643759232d222175340fe7ed378fb4c71126cb1d5247cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / libvt-0.0.1a0-py3-none-any.whl
| Download URL | libvt-0.0.1a0-py3-none-any.whl |
|---|---|
| Size | 132.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
619b635ab87cca9aa3b49877894f041e0f6859468ba7379d33041495f3a45c13
|
|
BLAKE2b-256 checksum How to use checksums |
91ce34500dd117bafed573ccab711d616369d2ef301db796bb07c7d652ebd91e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for libvt 0.0.1a0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for libvt-0.0.1a0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.