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.8.0b1.tar.gz
(11.3 kB
view details)
Built Distribution
cli_ui-0.8.0b1-py3-none-any.whl
(11.8 kB
view details)
File details
Details for the file cli-ui-0.8.0b1.tar.gz
.
File metadata
- Download URL: cli-ui-0.8.0b1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70ecb1a4818085ecc57164c6c3516e011d0235ac6e0284a250c79f5ee6a18a5f |
|
MD5 | 5d5984d0ba1b7cda99cb45cbcb322017 |
|
BLAKE2b-256 | e70e4815851fe00b4ce6834d4d96fd2704753e540645491ba2e834f787811cf9 |
File details
Details for the file cli_ui-0.8.0b1-py3-none-any.whl
.
File metadata
- Download URL: cli_ui-0.8.0b1-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53dcfaf8e5db6db810c9fea381553178bfa19f320ad1242f600d6d66c42ec8e7 |
|
MD5 | 87d50cc22f996cc3380eadef26ee6e52 |
|
BLAKE2b-256 | 37cd3613495021f36cd880ebf5c73eace500472f045ab86294b57b8e115d8d21 |