Ultra CLI
ultra-cli is python module/library that generates flexible cli menus.
The approach that is considered of an app using ultra-cli is as defined below:
- The app have a
main menu - This
main menumight have some sub-menus - As each sub-menu can also have multiple sub-menus
- An end point for each menu where user can select what should happen next (excluding sub-menus), is called
Option Optionis a function that will be called when the user selects it in a menu.
Demonstration of how this works
MainMenu/
├─── SubMenu_1/
│ ├─── anotherSubMenu/
│ └─── myoption_1
└─── SubMenu_2/
├─── myoption_2
└─── myoption_3
In the example above, as you can see, App starts with a menu called MainMenu.
This contains 2 sub-menus called SubMenu_1 and SubMenu_2. This means you can navigate to one of these menus when you are in MainMenu.
Now if you navigate to SubMenu_1, you have 2 choices:
anotherSubMenuwhich is a sub-menu (empty)myoption_1which is anOptionobject that which will call a specified function when you navigate to it.
from ultra_cli import Menu,Option
# Creating main menu
main_menu = Menu(title="MainMenu")
# Creating other menus
privacy_menu = Menu(title="Privacy")
data_menu = Menu(title="Data and Storage")
# functions of our Options
def change_password_function():
print("password can not be changed")
def change_name_function(new_name):
print(f"your new name is: {new_name}")
# Defining the Options
change_password = Option(title="Change password", function=change_password_function)
change_name = Option(title="Change name", function=change_name_function, kwargs={"new_name":"MY_NEW_NAME"})
# Adding declared options to the privacy_menu options
privacy_menu.add_options(
change_name,
change_password
)
# Adding privacy_menu and data_menu to main_menu
main_menu.add_submenus(privacy_menu, data_menu)
# Start of the app
main_menu.execute()
Metadata
Release files for ultra-cli 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ultra-cli-0.6.0.tar.gz | 28.5 kB | Without provenance | Details |
Release files / ultra-cli-0.6.0.tar.gz
| Download URL | ultra-cli-0.6.0.tar.gz |
|---|---|
| Size | 28.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e2767d54b13e19e4f9f210bef4f3c7986a4e8ae791d7b2088c5680842839d93
|
|
BLAKE2b-256 checksum How to use checksums |
23816d9fe76ae6c39833cb3669f90f064727d9c916bc71cb026dfc169f0443e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for ultra-cli 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.