Zero-dependency POSIX terminal UI toolkit: truecolor ANSI with 256/16/mono fallback, raw keyboard input, diff-based renderer, styled canvas, and widgets.
Project description
puretui
A zero-dependency, pure-stdlib terminal UI toolkit for Python (POSIX).
A styled cell-grid canvas with clipped regions, truecolor ANSI with 256/16/mono fallback, flexbox-style layout, raw keyboard + mouse input (bracketed paste, focus events), a flicker-free diff renderer, procedural widgets, an app kit (views, keymaps, command palette), and snapshot testing — in about 3,000 lines you can read in an afternoon.
from puretui import Canvas, Fixed, Flex, Theme, run
from puretui import widgets
def render(cols, rows, frame):
cv = Canvas(cols, rows, widgets.base_style())
root = cv.region()
head, body = root.split_v(Fixed(2), Flex(1))
head.left("hello, puretui", r=0)
head.rule(r=1)
body.center("q to quit", r=body.h // 2)
return cv.to_lines()
run(render, on_key=lambda k: k not in ("q", "Q"))
- Zero dependencies. Python 3.8+ standard library only. POSIX (macOS/Linux).
- Explicit. Procedural drawing, plain data, no reactivity, no magic.
- Tested. 600+ unit tests, property tests, a fuzzed input decoder, and byte-exact golden snapshots.
- Fast. ~2ms full frames at 120x40; steady-state frames ~0.015ms
(
python3 benchmarks/bench.pyfor numbers on your machine).
Install
pip install puretui
Examples
python3 examples/dashboard.py # layout, tables, sparklines, mouse
python3 examples/logtail.py # app kit: views, filter capture, palette
Status
Pre-1.0: the API is stabilizing (__all__ defines the public surface;
see CHANGELOG.md). Built as the engine of a
World Cup terminal dashboard —
the flagship consumer that keeps every release honest with byte-identical
rendering oracles.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file puretui-0.6.0b1.tar.gz.
File metadata
- Download URL: puretui-0.6.0b1.tar.gz
- Upload date:
- Size: 90.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35084abb9fd2ad5fb21bb9ad75c69c5aaceb750fbcf00820833fd7abed4ccb29
|
|
| MD5 |
d88c9cda6d5c7770c6ec69b2f184c0b0
|
|
| BLAKE2b-256 |
58bbfd22a2f4c02a03293115f3238e7433b7375f91dae6fa399f47a6a2af9dd7
|
Provenance
The following attestation bundles were made for puretui-0.6.0b1.tar.gz:
Publisher:
release.yml on 0JamesAB/puretui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
puretui-0.6.0b1.tar.gz -
Subject digest:
35084abb9fd2ad5fb21bb9ad75c69c5aaceb750fbcf00820833fd7abed4ccb29 - Sigstore transparency entry: 2176295321
- Sigstore integration time:
-
Permalink:
0JamesAB/puretui@8e61fc05cc9bbafbf18c783642584dc23a1549ab -
Branch / Tag:
refs/tags/v0.6.0b1 - Owner: https://github.com/0JamesAB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e61fc05cc9bbafbf18c783642584dc23a1549ab -
Trigger Event:
push
-
Statement type:
File details
Details for the file puretui-0.6.0b1-py3-none-any.whl.
File metadata
- Download URL: puretui-0.6.0b1-py3-none-any.whl
- Upload date:
- Size: 45.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
233c7c8ae1d6eff2d974016ac4026167968f7e485a1ca4e14871d06a93caa210
|
|
| MD5 |
401a4b88d06ddf385b5e08251e1bfb30
|
|
| BLAKE2b-256 |
5cbf0094ba37ead9b74ec430bdf785964075bb28ecba1526010c0243033e45fe
|
Provenance
The following attestation bundles were made for puretui-0.6.0b1-py3-none-any.whl:
Publisher:
release.yml on 0JamesAB/puretui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
puretui-0.6.0b1-py3-none-any.whl -
Subject digest:
233c7c8ae1d6eff2d974016ac4026167968f7e485a1ca4e14871d06a93caa210 - Sigstore transparency entry: 2176295461
- Sigstore integration time:
-
Permalink:
0JamesAB/puretui@8e61fc05cc9bbafbf18c783642584dc23a1549ab -
Branch / Tag:
refs/tags/v0.6.0b1 - Owner: https://github.com/0JamesAB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e61fc05cc9bbafbf18c783642584dc23a1549ab -
Trigger Event:
push
-
Statement type: