On this page
carets
Prev: expose-api | Up: projects | Next: spatial-ui
Rel: wispsy, Frameworks, hypnosis, escape-colors
Ref: wispsy on GitHub
Tags: #public #wispsy #project #frameworks #tier/core
Role
A lightweight, dependency-free Python 3.10+ asyncio terminal UI toolkit featuring incremental ANSI input parsing, immutable components, named zones, forms, Command.stream, and a cell-diffing renderer with DEC synchronized output.
Install
pip install carets==0.2.0
Quickstart
import asyncio
from carets import Program
from carets.components import TextInput
async def main():
model = TextInput(placeholder="Type here")
await Program(model).run()
asyncio.run(main())
When to Reach for It
- Building interactive POSIX terminal applications without heavy TUI dependency stacks.
- Reach for spatial-ui when targeting browser-based square-grid spatial UIs.
Gotchas & Pitfalls
- POSIX terminal assumptions: Relies on POSIX TTY raw mode, ANSI escape sequences, and DEC synchronized output—redirected or non-TTY stdout needs a headless/test driver rather than interactive mode.
- Asyncio event loop ownership: Interactive apps run inside
asyncio; avoid blocking synchronous I/O directly inside render or key-event handlers (offload viaCommand.streamor worker threads). - Immutable component tree: Components are immutable snapshots diffed cell-by-cell; mutating state in place without emitting a new state update skips re-rendering.
Pairs With
- hypnosis — Uses Carets 0.2.0 for its interactive workbench terminal application.
- compose-application — Generates standalone
expose-interface+caretsterminal projects.
Metadata
type: project-card
slug: carets
org: wispsy
repo: wispsy/carets
package: carets
version: 0.2.0
requires_python: ">=3.10"
layer: frameworks
topic: wispsy-framework
status: active
language: python
source_docs: README.md, docs/
Linked from
Related notes
- wiki/projects/expose-api Linked here; links to this page; shared tags: #frameworks, #project, #tier, #wispsy
- wiki/projects/hypnosis Linked here; links to this page; shared tags: #frameworks, #project, #tier, #wispsy
- wiki/projects/spatial-ui Linked here; links to this page; shared tags: #frameworks, #project, #tier, #wispsy
- wiki/projects/compose-application Linked here; links to this page; shared tags: #project, #tier, #wispsy
- wiki/stack/frameworks Linked here; links to this page; shared tags: #frameworks, #tier, #wispsy
- wiki/orgs/wispsy Linked here; links to this page; shared tags: #tier, #wispsy
- wiki/projects Linked here; links to this page; shared tags: #wispsy
- wiki/projects/escape-colors Linked here; shared tags: #project, #tier, #wispsy
- wiki/projects/function-sequence links to this page; shared tags: #project, #tier, #wispsy
- wiki/projects/peaches links to this page; shared tags: #project, #tier, #wispsy