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


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.5.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

error_helper-1.5-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for error_helper-1.5.tar.gz
Algorithm Hash digest
SHA256 ee46f31a689db19ce1a04e69f437639faa0373e1d4ce4374db2912d1ed09a1d6
MD5 f1a8f52cfae265bf0731b6d508b0301b
BLAKE2b-256 708bccc4ebf65e3e6ea3144f7c5f3d0ac3a3f2c9382421856d58fbd21c953d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for error_helper-1.5.tar.gz:

Publisher: publish.yaml on 30350n/error_helper

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

File details

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

File metadata

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

File hashes

Hashes for error_helper-1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fe3b0d05b843ff7eba0436519ddebdce6825d00aeb29c386824decc09d56673f
MD5 eb6db4e882462cd0f8b82ee9bc56c0bd
BLAKE2b-256 e7952e28e21f9a458ce88328796c73fab57376c716f4e56d157a650588026d96

See more details on using hashes here.

Provenance

The following attestation bundles were made for error_helper-1.5-py3-none-any.whl:

Publisher: publish.yaml on 30350n/error_helper

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