Python Process User Intent: A high-level abstract UI system (TUI, Web, Voice)
Project description
PPUI: Python Process User Intent 🎭
A high-level abstract UI system for Python scripts.
PPUI (pronounced "pui") is the Python implementation of the PUI (Process User Intent) philosophy.
The goal isn't just to "draw a menu"—it's to capture what the user wants to do next. Whether that intent is captured via a terminal hotkey, a web click, or a voice command, the script's logic remains the same.
PPUI: Because your scripts should care about what you want, not just how you say it.
Features
- High-level Abstractions: Use concepts like
SelectionandInputwithout caring about the rendering engine. - TUI Implementation: Professional, hotkey-driven terminal menus.
- Submenu Support: Nested selections with
push(drill-down) orinline(expandable) behaviors. - Rich Integration: Full support for Rich-formatted output and panels.
- Presentable Blocks: High-level
CodeBlock,DataTable, andPanelSectionprimitives for showing code, tables, and sections.
Installation
pip install ppui
Usage
High-Level Menu Class
The Menu class provides a declarative way to build interactive loops with callback support.
from ppui import Menu
def run_setup():
print("Running setup...")
def main():
menu = Menu("Project Manager", style="bold green")
menu.add_option("Setup Project", run_setup)
menu.add_option("View Dashboard", "view_dash")
# Submenu support
advanced = Menu("Advanced Settings")
advanced.add_option("DNS Config", lambda: print("Configuring DNS..."))
menu.add_submenu("Advanced...", advanced, behavior="push")
menu.add_back_item()
menu.add_quit_item()
selection = menu.run()
Notes for AI Coding Agents
-
Think in intents, not widgets
- Use PPUI to capture user intent (selections, confirmations, inputs), not to directly manipulate low-level UI widgets.
- Application code should express what the user is choosing or providing, not how it is rendered.
-
Allowed imports in application code (e.g.
services/*,media/*,utils/*):- From
ppui:Menu,UIElement,Selection,Option,PresentableCodeBlock,DataTable,PanelSectionfor high-level code/table/section renderingprompt_yes_no,console,prompt_toolkit_menu,format_menu_choices,copy_to_clipboard
- From
helpers.core:run_command,load_pas_config,save_pas_config, and other non-UI helpers.
- From
-
Forbidden in application code:
- Direct imports from low-level UI libraries such as:
from rich.panel import Panelfrom rich.syntax import Syntaxfrom rich.table import Table
- Direct
prompt_toolkitorquestionaryusage. - These are implementation details inside PPUI, not part of the public surface for tools.
- Direct imports from low-level UI libraries such as:
-
Menu pattern to use (example):
from ppui import Menu, prompt_yes_no, console
def manage_project(path):
while True:
console.print(f"Managing: {path}")
menu = Menu("Project Actions", style="bold cyan")
menu.add_option("Deploy to Staging", deploy_staging)
menu.add_option("Deploy to Prod", deploy_prod)
menu.add_back_item()
menu.add_quit_item()
selection = menu.run(loop=False)
if selection in ["back", "quit"]:
break
- Extending PPUI
- If you need richer concepts (forms, layouts, dashboards, etc.), add new abstractions to PPUI (e.g.
Form,Layout) and implement them here. - Do not introduce new
rich/prompt_toolkitimports in application code; route them through PPUI so the same intent can later be rendered as TUI, web, or voice.
- If you need richer concepts (forms, layouts, dashboards, etc.), add new abstractions to PPUI (e.g.
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 ppui-2026.1.23.tar.gz.
File metadata
- Download URL: ppui-2026.1.23.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6caa9f1cd60f8610710cc635170b541de1368e22bcb3d9874f306c747adc5cb5
|
|
| MD5 |
d62ad39f54e8f797f0ab611dfb27a929
|
|
| BLAKE2b-256 |
048ab0a57d770ea10a9bd52a872827924ea71c8206f04c92c726b5bee8083dab
|
File details
Details for the file ppui-2026.1.23-py3-none-any.whl.
File metadata
- Download URL: ppui-2026.1.23-py3-none-any.whl
- Upload date:
- Size: 8.0 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 |
2e46e6231c6bc6a6ef7e574d54afc52f0221ed0c65635b1a889752c2a8ba1f41
|
|
| MD5 |
678d55a949425a1b6aaf5eacdbead270
|
|
| BLAKE2b-256 |
8bb72d2f19888ee8524669f67eb945d548e71b6082aead0bcb54e4a92907c7c7
|