Build Nice User Interfaces In The Terminal
Project description
python-cli-ui
Tools for nice user interfaces in the terminal.
Note
This project was originally hosted on the TankerHQ organization, which was my employer from 2016 to 2021. They kindly agreed to give back ownership of this project to me. Thanks!
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!
Contributing
We use optimistic merging so you don’t have to worry too much about formatting the code, pleasing the linters or making sure all the test pass.
That being said, if you want, you can install just and use it to check your changes automatically. Just run just to see available tasks.
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
Built Distribution
File details
Details for the file cli-ui-0.17.2.tar.gz
.
File metadata
- Download URL: cli-ui-0.17.2.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.6 Linux/5.19.4-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f67e50cf474e76ad160c3e660bbad98bf8b8dfb8d847765f3a261b7e13c05fa |
|
MD5 | 1c0c4892de053f33bad9506e516e2008 |
|
BLAKE2b-256 | ec4692401c78c4fe36529393879c09fa00ff7b6c4d72807f4010a79e762eafca |
File details
Details for the file cli_ui-0.17.2-py3-none-any.whl
.
File metadata
- Download URL: cli_ui-0.17.2-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.6 Linux/5.19.4-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a1ebdbbcd83a0fa06b2f63f4434082a3ba8664aebedd91f1ff86b9e4289d53e |
|
MD5 | 1345d1e79496ecb199ad43642bf917a4 |
|
BLAKE2b-256 | 3e977c2e6396bfe56c8dd10de04a1c4a82c6b3ee77d468862f588ac51ea1ebad |