Build Nice User Interfaces In The Terminal
Project description
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.10.0.tar.gz
(11.5 kB
view details)
Built Distribution
cli_ui-0.10.0-py3-none-any.whl
(20.9 kB
view details)
File details
Details for the file cli-ui-0.10.0.tar.gz
.
File metadata
- Download URL: cli-ui-0.10.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f767e3ffe14e38afc836dee49247128116bc0aafb672b223d87235799a2c20f |
|
MD5 | eb7a93a90b8406619d01129268af06e8 |
|
BLAKE2b-256 | 383a5a6f500759b90141d8611ba0eb198ca907c2216d7e414813c8c371acf70f |
File details
Details for the file cli_ui-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: cli_ui-0.10.0-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfc3b6c1192f625f5a02f8f522df5b748ecc464d15a2cba8853506e486ff87f9 |
|
MD5 | e610ea9cb09b80858bc7da0b5857a264 |
|
BLAKE2b-256 | 4d3e4c1b6b0c98d9bdeeb347d47f7b7b14c7529b77701470d97416f9905f64ce |