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.1.tar.gz
(11.4 kB
view details)
Built Distribution
cli_ui-0.10.1-py3-none-any.whl
(11.7 kB
view details)
File details
Details for the file cli-ui-0.10.1.tar.gz
.
File metadata
- Download URL: cli-ui-0.10.1.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.2 CPython/3.7.1 Linux/5.4.0-3-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4543c8c6f4436e07f3dd347ad084674eba499ceeeba871ff3cc2152185a0230a |
|
MD5 | 5bb24798558d0efddee48466163eeb0e |
|
BLAKE2b-256 | 5795503e18587cfc717637320bfd93b1035a5decc131e22a28aecaf8872c47f0 |
File details
Details for the file cli_ui-0.10.1-py3-none-any.whl
.
File metadata
- Download URL: cli_ui-0.10.1-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.2 CPython/3.7.1 Linux/5.4.0-3-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ed63907670347ad52f9861eb41ef0b522a3a54fde5361057246eccab0f376c0 |
|
MD5 | a615805c7cd606badb98d27daf39c0a9 |
|
BLAKE2b-256 | e8d325f56beeb0904d4efe23480965c16d4913e75ce4c59b349516200f5cacc6 |