https://github.com/gbpagano/rich_menu
Rich menu is a library that allows the quick and simple creation of cli menus.
https://github.com/gbpagano/rich_menu
cli-app menu-navigation python terminal
Last synced: 6 months ago
JSON representation
Rich menu is a library that allows the quick and simple creation of cli menus.
- Host: GitHub
- URL: https://github.com/gbpagano/rich_menu
- Owner: gbPagano
- License: mit
- Created: 2023-10-02T01:17:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-23T03:12:43.000Z (over 1 year ago)
- Last Synced: 2025-04-23T06:46:10.671Z (6 months ago)
- Topics: cli-app, menu-navigation, python, terminal
- Language: Python
- Homepage:
- Size: 49.8 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rich Menu
Rich menu is a library that allows the quick and simple creation of cli menus, using [Rich](https://github.com/Textualize/rich) as a backend.
## Installation
Installation is very simple, just run the following command in the terminal:
```bash
pip install rich-menu
```## Basic Usage
```python
from rich_menu import Menumenu = Menu(
"Option 1",
"Option 2",
"Option 3",
"Exit",
)
match menu.ask():
case "Option 1":
print("first option selected")
case "Option 2":
print("second option selected")
case "Option 3":
print("third option selected")
case "Exit":
exit()```
```python
from rich_menu import Menumenu = Menu(
"X",
"O",
color="blue",
rule_title="Tic Tac Toe",
align="center",
panel_title="Choose your icon",
selection_char="->",
)
selected = menu.ask(screen=False)
```