Skip to main content

Python library for color beautiful output and logging

Project description

PyColor-palette

This library is designed to display text using colors and formatting, as well as logging and debugging. Debugging is done using logger.

Used projects: icecream source code and loguru module

Install

pip3 install pycolor_palette-loguru

Example

#!venv/bin/python3
"""pycolor_palette Example File.

Copyright Alexeev Bronislav (C) 2024
"""
from loguru import logger
from pycolor_palette_loguru.logger import PyDBG_Obj, benchmark, set_default_theme, debug_func, setup_logger
from pycolor_palette_loguru.paint import info_message, warn_message, error_message, other_message, FG, Style, debug_message, run_exception
from pycolor_palette_loguru.pygments_colorschemes import CatppuccinMocha

set_default_theme(CatppuccinMocha)
pydbg_obj = PyDBG_Obj()
setup_logger('DEBUG')


@benchmark
@debug_func
def debug_print() -> list:
	num = 12
	float_int = 12.12
	string = 'Hello'
	boolean = True
	list_array = [1, 2, 3, 'Hi', True, 12.2]
	dictionary = {1: "HELLO", 2: "WORLD"}

	pydbg_obj(num, float_int, string, boolean, list_array, dictionary)


debug_print()
logger.debug("This is debug!")
logger.info("This is info!")
logger.warning("This is warning!")
logger.error("This is error!")

# Simple messages
info_message('INFORMATION')
warn_message('WARNING')
error_message('EXCEPTION')
debug_message('DEBUG')
other_message('SOME TEXT', 'OTHER')
# Highlight bg
info_message('Highlight INFORMATION', True)
warn_message('Highlight WARNING', True)
error_message('Highlight EXCEPTION', True)
debug_message('Highlight DEBUG', True)
other_message('Highlight SOME TEXT', 'OTHER', True)

print(f'{FG.red}{Style.bold}BOLD RED{Style.reset}{Style.dim} example{Style.reset}')

run_exception('EXCEPTION')

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

pycolor_palette_loguru-0.2.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

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

pycolor_palette_loguru-0.2.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pycolor_palette_loguru-0.2.0.tar.gz.

File metadata

  • Download URL: pycolor_palette_loguru-0.2.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.12.0-1-cachyos

File hashes

Hashes for pycolor_palette_loguru-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0dd2103abfcc983c2cfc57a45fea3320b9af1bae912dabceda9789d618eb720b
MD5 f8cb8309b6990e967ab5b589c4d2bef6
BLAKE2b-256 d41bcbd7b67903e72b5b6eb6c5ee2c27c4cc6f3beb267267fbae46e4301d28ce

See more details on using hashes here.

File details

Details for the file pycolor_palette_loguru-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pycolor_palette_loguru-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 665351b5d14d4acfed08815af3fe6a6414e6cf63573cf7f8d7a4f0b226a01e38
MD5 33397105c9bf750f9a2c85e7e75ad34e
BLAKE2b-256 c12c9903dafc5ad6b76d3d2b98f8af7bdb894ffdcc07b1a7439d63cc04823c87

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