Skip to main content

Have a nice looking, simple cli in seconds

Project description

cliasi (cli easy)

GitHub issues PyPI

Output pretty command line text without hassle.
This is mostly a collection of pretty print commands

View the documentation here.

Installation

pip install cliasi
uv add cliasi

Basic Usage

from cliasi import cli

cli.success("It works!")
# > ✔ [CLI] | It works!

cli.messages_stay_in_one_line = True
# The next few lines will get overwritten
cli.info("blah")
cli.warn("doing something dangerous")
# > ! [CLI] | doing something dangerous

Read more about different message types and see visualizations in the documentation here.

Animations

One of the main features of cliasi is the ability to display animations while waiting for something to finish.

# File: examples/readme_demo.py
from cliasi import cli

# This will wait for three seconds and display an animation
task = cli.animate_message_non_blocking(
    "Saving files...",
    message_right="[CTRL-C to abort]",
    messages_stay_in_one_line=True
)
do_stuff()
task.update("Files saved, waiting for process to quit", message_right="70%")
tell_process_to_quit()
task.stop()
cli.success("Process quit", message_right="100%")

readme_demo

Catching exceptions

cliasi also catches exceptions and displays them in a pretty way. This then looks something like this:

# exception_message.py
import cliasi

# Importing cliasi automatically installs the logging handler
raise ValueError("An example error")

Example CLI output (uncolored, see colored version in docs):

X [CLI] | Uncaught exception:
X [CLI] | Traceback (most recent call last):
        |   File "examples/exception_message.py", line 4, in <module>
        |     raise ValueError("An example error")
        | ValueError: An example error

Other features

cliasi has many more features like:

  • Logging integration
  • Custom message alignments
  • Customizable progressbars (with PBCalculationMode)
  • And more!

Contributing:

This is just a fun project of mine mainly to try out python packaging. If you would like to contribute or have a feature-request, please open an issue or pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cliasi-0.4.1.tar.gz (238.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cliasi-0.4.1-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file cliasi-0.4.1.tar.gz.

File metadata

  • Download URL: cliasi-0.4.1.tar.gz
  • Upload date:
  • Size: 238.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cliasi-0.4.1.tar.gz
Algorithm Hash digest
SHA256 ce378f26a1a2073bd340951af9bdd7a031272752d36c7c5870d522f11990f3b2
MD5 f64291b33f7b20c59addf993ff597e24
BLAKE2b-256 3de4f535ad1d7e2bb89c85bb2efd8e4be536accaebe6fe4e2bbd87b532e91ba9

See more details on using hashes here.

Provenance

The following attestation bundles were made for cliasi-0.4.1.tar.gz:

Publisher: publish.yml on IgnyteX-Labs/cliasi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cliasi-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: cliasi-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cliasi-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a8a69a835741ea2bb8671abaef5296c53ef58ff3894c41dd5d9f623ad501e9d
MD5 941db13ee2f2e61b1776a500744179da
BLAKE2b-256 b6ad818eae13a8cadf27086cb8ed237c3018c90d93d1af18d9a880364f6bf26b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cliasi-0.4.1-py3-none-any.whl:

Publisher: publish.yml on IgnyteX-Labs/cliasi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page