cliasi¶
is a tiny command-line interface (CLI) library for Python.
It is meant to be simple and easy to use, while providing useful features for building hobby project command-line applications. It offers
Pre-configured global instance for quick usage.
support for logging
colored output
left, right and centered text alignment
progress bars and animations
message types similar to logging
Set up:¶
Install with pip / uv:
pip install cliasi==0.4.2
uv add cliasi==0.4.2
Here is a quick example to get you started:
from cliasi import Cliasi
cli = Cliasi(min_verbose_level=20, messages_stay_in_one_line=True, colors=True)
cli.success("Installation successful!")
cli.set_prefix("hobby_app")
progressbar = cli.progressbar_animated_download("Downloading...", show_percent=True)
# Do some downloading work here...
for i in range(70):
do_something()
progressbar.update(progress=i)
do_task_that_takes_long_time()
progressbar.update(progress=100)
# Finish download
clean_up()
progressbar.stop()
cli.success("Download complete!", message_right="100%")
All of this text stays in one line.
Why cliasi¶
Cliasi is small and primarily designed for basic animations and progressbars.
Minimal API with sensible defaults (see about options here Cliasi instances).
Supports logging levels for verbosity control.
Will auto-format exceptions from other libraries Logging Integration
Wide variety of message types all named unambiguously. Message types and animations
Text alignment options for messages. Message alignment
Disappearing messages to keep the terminal clean. (
messages_stay_in_one_lineoption)Prefix system to indicate program scope. Cliasi instances
Note on windows support¶
I do not own a windows device so windows support is untested. If there are any issues please open an issue on GitHub or feel free to open a PR with fixes.
Further reading¶
Guide