A professional, hotkey-driven TUI system for Python CLIs
Project description
pas-tui
A professional, hotkey-driven TUI system for Python CLIs.
This is part of the PAS Toolkit which will be open-sourced in the future, but can be used independently.
Installation
pip install pas-tui
Features
- Numerical index padding (01, 02, etc.)
- Automatic hotkey mapping (1-9, q for Quit, b for Back)
- Rich-formatted output
- Cross-platform clipboard support
Usage
High-Level Menu Class (Recommended)
The Menu class provides a declarative way to build interactive loops with callback support, encapsulating headers and state.
from pas_tui import Menu
def run_setup():
print("Running setup...")
def main():
# 1. Initialize with title
menu = Menu("Project Manager", style="bold green")
# 2. Add items with direct callback support or return values
menu.add_item("Setup Project", run_setup)
menu.add_item("View Dashboard", "view_dash")
# 3. Add standard navigation
menu.add_back_item()
menu.add_quit_item()
# 4. Start the interactive loop
selection = menu.run()
if selection == "view_dash":
print("Opening dashboard...")
if __name__ == "__main__":
main()
Low-Level Interactive Menus
Confirmation Prompts
from pas_tui import prompt_yes_no
if prompt_yes_no("Do you want to proceed with the deletion?", default=False):
print("Deleting...")
else:
print("Aborted.")
Clipboard Support
from pas_tui import copy_to_clipboard
if copy_to_clipboard("Hello from pas-tui!"):
print("Copied to clipboard!")
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 Distribution
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 pas_tui-2026.1.20.2.tar.gz.
File metadata
- Download URL: pas_tui-2026.1.20.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2fea12b2fd140395fa682747caeb4de1281f59c378610665410e002135d7f67
|
|
| MD5 |
300ff465abe462febca5a8115cd13295
|
|
| BLAKE2b-256 |
fe5a926ae17d432f5f7149fea0265a9d726d9fcfff8779e79a1e444b848125cb
|
File details
Details for the file pas_tui-2026.1.20.2-py3-none-any.whl.
File metadata
- Download URL: pas_tui-2026.1.20.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2725a2ed9de457bf4773d53c58cdb29de95d93b9f662d869638d0ba280cfe6db
|
|
| MD5 |
55be8dfb9109933bf783f86a3b89ecde
|
|
| BLAKE2b-256 |
b97cd6bf5376f3778749a497842912b0034d4dc63b7f9aaecc0aadc7336b1de2
|