Skip to main content

A module for printing colored text to the terminal

Project description

Basic colors

This Python module provides you with:

  • set of variables that you can use to color your text in terminal,
  • logging like messages with or without icons,
  • verbose on/off printing.

Installation

You can install the module using pip:

pip install basic-colors

Usage

Module basic_colors provides you with a set of variables that you can use to color your text in terminal.

Colored text

from basic_colors import *

print(Blue + "Ahoj" + Reset)

Logging like messages

from basic_colors import enable_icons, print_info, print_warning, print_error, verbose_print, 

enable_icons(True)
print_info("This is an info message.")
print_warning("This is a warning message.")
print_success("This is a success message.")
print_error("This is an error message.", False)
 ℹ️  Info: This is an info message.     
⚠️ Warning: This is a warning message.
âś… Success: This is a success message.  
❌ Error: This is an error message.

(in color)

Verbose print

The set_verbose(True) command enables verbose printing. If you want to print a message only in verbose mode, use the verbose_print() function.

from basic_colors import set_verbose, verbose_print

set_verbose(False)
verbose_print("This is a non-verbose message.")
set_verbose(True)
verbose_print("This is a verbose message.")

Sources:

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

basic_colors-0.1.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

basic_colors-0.1.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file basic_colors-0.1.2.tar.gz.

File metadata

  • Download URL: basic_colors-0.1.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for basic_colors-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cd8ee39266b4ab26b269ce7e0810416319d3326e6988c34f255158f61418906b
MD5 16a2a4a4da1d8930be5ed30460d428d1
BLAKE2b-256 f222f7108c6d7ecddfaad348f7d75caa898caa509bfd76d6306ccf590953779c

See more details on using hashes here.

File details

Details for the file basic_colors-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: basic_colors-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for basic_colors-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fc6508054837679c390d6d1a0ba784f6024b56b5b0cbbe8adcc9819174189cd2
MD5 41cd30bc60fe51a3294eb9951aded585
BLAKE2b-256 7c12bdb69e8a76e23c73054cd87bf3be80cd85dce526d22517ad868c2fd791f5

See more details on using hashes here.

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