Skip to main content

Minimalistic python module to print colorful messages

Project description

pypi python mit

error-helper

This is a minimalistic python module which helps you print colorful messages for CLI tools. It's available on PyPi, but you can also add it to your project as a git submodule.

Usage

>>> from error_helper import *
>>> info("this is information")                    # output will be blue
this is information
>>> hint("this is less important information")     # output will be grayed out
this is less important information
>>> warning("something didn't go quite right...")  # output will be yellow
warning: something didn't go quite right...
>>> error("something went terribly wrong")         # output will be red
error: something went terribly wrong
>>> success("completed the operation!")            # output will be green
successfully completed the operation!

prompt(...) and prompt_input(...)

The prompt(...) function, by default, prints a newline, followed by the provided values, a colon and another newline:

>>> prompt("enter the server url")

enter the server url:
>>>

The prompt_input(...) function, by default, prints the provided values, followed by a colon and a space. Then it calls the default input(...) function and returns it's result. The result will be stripped if strip=True (default).

>>> prompt("enter the server url"); url = prompt_input("url:")

enter the server url:
url:  https://30350n.de
>>> url
'https://30350n.de'

Project details


Release history Release notifications | RSS feed

This version

1.1

Download files

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

Source Distribution

error_helper-1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

error_helper-1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file error_helper-1.1.tar.gz.

File metadata

  • Download URL: error_helper-1.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for error_helper-1.1.tar.gz
Algorithm Hash digest
SHA256 7753b3e7509373b7f525ced9b98da3bed09e3c3839c93405b061f00e5a7e67ab
MD5 2397bec09441de3a186a876fb754017c
BLAKE2b-256 6088758fd5b19e6707c9fbc93c32fadb665c5b852c88766a007f364d609075a7

See more details on using hashes here.

Provenance

File details

Details for the file error_helper-1.1-py3-none-any.whl.

File metadata

  • Download URL: error_helper-1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for error_helper-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3de743b53456f959d79d2bd46d2e2d26899e90a675aba44ceef2da420118ad01
MD5 52b91e347e08c8dfbbd3fd82432a4ec3
BLAKE2b-256 427bb01f50d07b4013b7519a32e1f491940fc6fced952a58395f6ff4f3889295

See more details on using hashes here.

Provenance

Supported by

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