Build Nice User Interfaces In The Terminal
Project description
python-cli-ui
Tools for nice user interfaces in the terminal.
Documentation
Demo
Watch the asciinema recording.
Usage
$ pip install cli-ui
Example:
import cli_ui
# coloring:
cli_ui.info(
"This is",
cli_ui.red, "red", cli_ui.reset,
"and this is",
cli_ui.bold, "bold"
)
# enumerating:
list_of_things = ["foo", "bar", "baz"]
for i, thing in enumerate(list_of_things):
cli_ui.info_count(i, len(list_of_things), thing)
# progress indication:
cli_ui.info_progress("Done", 5, 20)
cli_ui.info_progress("Done", 10, 20)
cli_ui.info_progress("Done", 20, 20)
# reading user input:
with_sugar = cli_ui.ask_yes_no("With sugar?", default=False)
fruits = ["apple", "orange", "banana"]
selected_fruit = cli_ui.ask_choice("Choose a fruit", choices=fruits)
# ... and more!
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
cli-ui-0.12.0.tar.gz
(12.1 kB
view details)
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
cli_ui-0.12.0-py3-none-any.whl
(12.5 kB
view details)
File details
Details for the file cli-ui-0.12.0.tar.gz.
File metadata
- Download URL: cli-ui-0.12.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.10.14-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc03bd64c08212aa13dca0f086ce48def978829f5b6759d1795f395272c141fb
|
|
| MD5 |
3cc37b7075fa48c219073d8dd4840136
|
|
| BLAKE2b-256 |
ecac6ff7e710f8ecd912f34bf98b23ef3bc394941b647f25020c5da22c047321
|
File details
Details for the file cli_ui-0.12.0-py3-none-any.whl.
File metadata
- Download URL: cli_ui-0.12.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.10.14-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
910786e2c8b4c0836d342c50ee2edaf1dd0ae8a3ffe62ea2bc1828970b98e4a5
|
|
| MD5 |
23b26614ef94e53e6555e6ba41a996ab
|
|
| BLAKE2b-256 |
918db9372aa223ca77a625691cfca4a1e02422fc4a720800855deeac81f4b954
|