Skip to content

Latest commit

 

History

History
82 lines (68 loc) · 3.94 KB

public-api.md

File metadata and controls

82 lines (68 loc) · 3.94 KB

Public API

Root Namespace and Submodules

Every module documented under API Reference is public API.

Top-level {mod}libvt resolves a focused quickstart surface lazily via PEP 562 ({class}~libvt.style.Appearance, {class}~libvt.views.Cell, {class}~libvt.events.Event, {exc}~libvt.exc.LibVtError, {class}~libvt.config.Limits, {class}~libvt.config.Policy, {class}~libvt.config.Profile, {exc}~libvt.exc.ProtocolError, {class}~libvt.screen.Screen, {class}~libvt.snapshot.Snapshot, {class}~libvt.style.Style, {class}~libvt.terminal.Terminal, __version__, {func}~libvt.terminal.render, and {func}~libvt.terminal.strip) so import libvt and pytest11 plugin discovery do not load emulator modules or Unicode tables until accessed.

Import specialized types and helpers from their owning submodules:

  • {mod}libvt.config and {mod}libvt.profiles — capability groups, security policies, resource ceilings, and host terminal presets
  • {mod}libvt.events, {mod}libvt.modes, and {mod}libvt.style — structured events, ANSI/DEC modes, colors, and hyperlinks
  • {mod}libvt.parser, {mod}libvt.screen, {mod}libvt.views, {mod}libvt.snapshot, {mod}libvt.format, {mod}libvt.recorder, and {mod}libvt.terminal — streaming VT500 parser, screen grids and views, immutable snapshots, incremental {class}~libvt.snapshot.SyncToken / {class}~libvt.snapshot.ScreenDelta replicas, {class}~libvt.snapshot.CellSpan coordinates, {class}~libvt.format.Formatter, and {class}~libvt.recorder.TerminalRecorder
  • {mod}libvt.input, {mod}libvt.aio, and {mod}libvt.codec — mode-aware input encoders, {class}~libvt.aio.AsyncSession transports, and sequence disassembly
  • {mod}libvt.testing — zero-dependency screen assertions ({func}~libvt.testing.assert_screen, {func}~libvt.testing.assert_screen_box) and boxed VT snapshot serialization, scrubbing, and diffing ({func}~libvt.testing.serialize_vt_snapshot, {func}~libvt.testing.vt_screen, {func}~libvt.testing.format_vt_diff_lines)
  • {mod}libvt.pytest_plugin — optional pytest fixtures (libvt[pytest]): {fixture}vt_terminal, {fixture}vt_factory, {fixture}vt_recorder, {fixture}vt_parser, and {fixture}vt_pty
  • {mod}libvt.contrib.tmux ({mod}~libvt.contrib.tmux.profile, {mod}~libvt.contrib.tmux.capture, {mod}~libvt.contrib.tmux.window, {mod}~libvt.contrib.tmux.control) — decoupled tmux inner-pane profiles, capture-pane decoders, multi-pane window compositing, and -C / -CC control-mode parser and pane sync
  • {mod}libvt.contrib.subprocess — synchronous child processes with {func}~libvt.contrib.subprocess.open_terminal and {func}~libvt.contrib.subprocess.run_terminal on POSIX PTYs and Windows ConPTY
  • {mod}libvt.contrib.syrupy — optional syrupy .ambr adapter (libvt[syrupy]): {class}~libvt.contrib.syrupy.VtSnapshotExtension and conditional {fixture}vt_snapshot pytest11 fixture

What Is Internal

Modules prefixed with _ (such as libvt._grid or libvt._ucd) are not public. They may change or be removed without notice between any release.

Pre-1.0 Stability Policy

libvt is in pre-alpha (0.0.1a7) and pre-1.0:

  • Pre-0.1 releases (0.0.x) and minor versions (0.x -> 0.y) may include breaking API changes.
  • Patch versions (0.x.y -> 0.x.z, for x >= 1) contain bug fixes only.
  • Pin your dependency: use libvt>=0.0.1a7,<0.1 for the 0.0.x series (and >=0.x,<0.y once 0.1.0 is released).

Breaking changes are recorded in changelog and migration.

Deprecation Process

Before removing or changing public API (from 0.1.0 onward):

  1. Emit a DeprecationWarning for at least one minor release.
  2. Document the replacement in deprecations and migration.
  3. Remove the deprecated symbol in a subsequent minor release.