Skip to content

Repository files navigation

curses-tui

Lightweight terminal UI and theme support for Python curses applications

License: MIT Python 3.9+

Inspired by FlossWare curses-java, this library provides reusable terminal UI primitives and professional theme support for Python's standard curses module.

Role in FlossWare TUI

curses-tui is the Python implementation layer for the language-neutral FlossWare/tui-schema contract. The schema defines portable JSON structure and semantic actions; this library provides native terminal rendering, interaction, windows, menus, focus, geometry, and themes.

The canonical contract is JSON only. YAML and XML are intentionally excluded. Application actions remain semantic identifiers and are resolved by the consuming application.

Features

  • 🎨 Built-in professional and retro themes
  • 🪟 Reusable windows, dialogs, popups, and panels
  • 📋 Reusable menus, menu items, and accelerators
  • 🎯 Focus, keyboard, mouse, geometry, movement, and resizing primitives
  • 🔌 Pluggable architecture for application-specific integration
  • 🔄 Runtime theme switching
  • 🖥️ Terminal-aware color handling with fallbacks
  • 📦 Python standard-library curses foundation
  • 🧪 Thoroughly tested
  • 📚 Designed to consume the tui-schema 1.0 contract without duplicating it

Python package

The Python distribution is curses-tui and the import namespace is curses_tui.

from curses_tui import ThemeManager, WindowManager

The former curses_themes package name is intentionally unsupported. This is a breaking package rename.

TUI schema integration

The shared contract is maintained in FlossWare/tui-schema. Version 1.0 defines typed widgets, top-level menus, semantic actions, focus, window behavior, absolute terminal-cell layout, and named themes.

curses-tui MUST NOT redefine the schema. It interprets supported schema documents and maps their portable concepts onto native Python/curses primitives.

Related Projects

  • tui-schema - Canonical language-neutral JSON TUI contract
  • curses-java - Java terminal UI library
  • agent-setup - FlossWare setup application consuming the shared TUI implementation

License

MIT - See LICENSE for details.

Author

FlossWare - https://github.com/FlossWare

About

Lightweight theme support for Python curses applications

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages