Rich terminal UI framework โ mouse, shaders, flexbox, Unicode
Project description
NeoTerm ๐
A rich terminal UI framework written in pure Python.
Cross-platform: Windows, macOS, Linux.
Features
| Feature | Details |
|---|---|
| ๐จ GPU-style shaders | rainbow, matrix, fire, wave, scanline โ per-cell, real-time |
| ๐ฑ๏ธ Full mouse support | Click, hover, scroll, drag โ SGR protocol |
| ๐ Unicode + emoji | Full CJK, emoji, box-drawing, braille, wide chars |
| ๐ Flexbox layout | row/column, flex_grow, gap, padding, align, justify |
| ๐ฌ Animation engine | Keyframe timelines, 12 easing functions, per-property |
| ๐ผ๏ธ Image display | Half-block Unicode rendering (requires Pillow) |
| ๐ฒ Widget system | Label, Button, TextInput, ProgressBar, Table, ScrollView, Spinner, Image |
| โก Diff renderer | Only changed cells are written โ very fast |
Quick Start
# No install needed โ just run directly
python examples/hello.py
python examples/demo.py
python examples/shader_gallery.py
Optional (for image display):
pip install Pillow
Usage
import neoterm as nt
from neoterm.layout import FlexStyle
app = nt.App(fps=30)
root = nt.Container(
direction="column",
gap=1,
padding=(1, 2, 1, 2),
border=True,
title="My App"
)
root.add(nt.Label("Hello, ๐!", bold=True, align="center"))
root.add(nt.Divider())
root.add(nt.Button("Quit", on_click=app.quit, style=FlexStyle(height=3)))
app.mount(root)
app.run()
Widgets
Label
nt.Label("Text ๐", bold=True, italic=False, fg=(255,200,0), align="center")
Button
nt.Button("Click me", on_click=lambda: print("clicked!"))
TextInput
inp = nt.TextInput(placeholder="Search...", on_submit=lambda v: print(v))
ProgressBar
bar = nt.ProgressBar(value=42, max_val=100)
bar.value = 75 # update anytime
Table
table = nt.Table(
columns=["Name", "Age", "City"],
rows=[["Alice", 30, "Istanbul"], ["Bob", 25, "Ankara"]],
on_select=lambda i, row: print(row),
sortable=True
)
ImageWidget
img = nt.ImageWidget(path="photo.jpg", width_cells=40, height_cells=20)
Spinner
nt.Spinner("Loading...", fg=(100, 200, 100))
Shaders
Apply a real-time shader to any widget:
container.set_shader("rainbow") # or: wave, matrix, fire, scanline, none
Available shaders: rainbow, wave, matrix, fire, scanline, none
Layout (Flexbox)
from neoterm.layout import FlexStyle
# Fixed size
widget = nt.Label("x", style=FlexStyle(width=20, height=3))
# Flexible โ fills remaining space
widget = nt.Label("x", style=FlexStyle(flex_grow=1))
# Row of equal buttons
row = nt.Container(direction="row", gap=1)
row.add(nt.Button("A", style=FlexStyle(flex_grow=1)))
row.add(nt.Button("B", style=FlexStyle(flex_grow=1)))
Animations
label = nt.Label("Fade in!")
label.animate("opacity", from_=0.0, to=1.0, duration=0.5, easing="ease_out_cubic")
Available easings: linear, ease_in, ease_out, ease_in_out,
ease_in_cubic, ease_out_cubic, ease_in_out_cubic,
ease_in_back, ease_out_back, bounce, elastic_in, elastic_out
Keyboard Shortcuts
| Key | Action |
|---|---|
Tab |
Next focusable widget |
Shift+Tab |
Previous focusable widget |
Ctrl+Q / Ctrl+C |
Quit |
โโ (in Table) |
Navigate rows |
Enter (in Table) |
Select row |
โโ |
Navigate / edit |
Project Structure
neoterm/
โโโ neoterm/
โ โโโ __init__.py # public API
โ โโโ platform.py # Windows/Unix terminal abstraction
โ โโโ canvas.py # double-buffered cell renderer
โ โโโ events.py # keyboard + mouse parsing
โ โโโ layout.py # flexbox layout engine
โ โโโ animation.py # keyframe timelines + cell shaders
โ โโโ widgets.py # all widgets
โ โโโ app.py # event loop
โโโ examples/
โโโ hello.py # minimal example
โโโ demo.py # full feature demo
โโโ shader_gallery.py
Requirements
- Python 3.8+
- No external dependencies (pure stdlib)
- Optional:
Pillowfor image display
Platform Notes
Windows: Requires Windows 10 1903+ for VT/ANSI support (automatic).
macOS/Linux: Works with any modern terminal (iTerm2, Kitty, Alacritty, GNOME Terminal, etc.).
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 Distributions
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 neoterm-1.0.1-py3-none-any.whl.
File metadata
- Download URL: neoterm-1.0.1-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c46292f47a56cfbef388caf55ecbcddc2bc088c6011ee4e0548116fca02906f5
|
|
| MD5 |
73a4597f1e199140cde2aa4af5127e7b
|
|
| BLAKE2b-256 |
d6ee6809d2ff771cede22922487353ac84787e8e5ce1e294ce33907836a32403
|