Skip to main content

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

# first install the library
neoterm-demo

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: Pillow for 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neoterm-1.0.2-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file neoterm-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: neoterm-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for neoterm-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7cbd77de89ca1686cb67639af76183b5459676da3af51bab7bc43f6ffc7ca66b
MD5 d6cec81156635ff1f66afd8c8b49409b
BLAKE2b-256 7eb34ae2e72ab97bda989ad3c296d775e8a6aed70f4f6644f31c0717708c29c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page