Skip to main content

This project implements a keyboard-controlled text user interface (TUI) for the terminal that allows users to navigate menus and nested subsections using simple key inputs (w, s, Enter, Esc). It provides a lightweight framework for building interactive CLI applications with features like menu navigation, dynamic subsections, progress bars, and confirmation prompts.

Project description

py_menu_tui

py_menu_tui is a lightweight terminal user interface (TUI) navigation framework for Python.
It allows developers to quickly build interactive command-line menus with keyboard navigation and nested subsections.

The interface is controlled using simple keys and is designed for Windows terminals using msvcrt.


Features

  • Keyboard navigation (w / s)
  • Nested menu sections
  • Simple function binding to menu entries
  • Scrollable menus
  • Progress bar utility
  • Confirmation prompts
  • No external dependencies

Installation

Currently the package can be installed with:

pip install py_menu_tui

Controls
Key	Action
w	Move up
s	Move down
Enter	Select option
Esc	Go back
Ctrl+C	Exit program
Example
from py_menu-tui import UserInterface

def hello():
    print("Hello World")

ui = UserInterface(10)

ui.setup(
    ["Say Hello"],
    [hello]
)

ui.begin()
Creating Subsections
ui.add_sub_section(
    ["Option 1", "Option 2"],
    [func1, func2],
    section="Settings"
)
Utilities
Progress Bar
from win_nav_tui import progressbar

progressbar(50)
Clear Terminal
from win_nav_tui import clear
Confirmation Prompt
from win_nav_tui import confirm

if confirm("Continue?"):
    print("Confirmed")

Requirements

  • Python 3+
  • Windows terminal (uses msvcrt)
  • No external dependencies

License

This project is licensed under the MIT License.

Project details


Download files

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

Source Distribution

py_menu_tui-0.2.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

py_menu_tui-0.2.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file py_menu_tui-0.2.1.tar.gz.

File metadata

  • Download URL: py_menu_tui-0.2.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for py_menu_tui-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fb861f6f84a0efedb6ea10e10cfb2bd1192e284effc0356f8530d30a80e8875c
MD5 4a3027d40c509fe0d16458becb58ecfb
BLAKE2b-256 ae26fcdf7d51e6fe5b4cdc83c3dbfcf7859299cb320ec29ad6936c5042459ba8

See more details on using hashes here.

File details

Details for the file py_menu_tui-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: py_menu_tui-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for py_menu_tui-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7cf35ea8ea471823c50d374da710a5a2d2826f761152cfc0e862aa53d8ccd6
MD5 0700a3ada57c38dbdcb9df1968ae7890
BLAKE2b-256 33b2a1848328dd4fcec59afe4dbaa8746f5e467b28fae5f7e3987933007654e1

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