Python library for color beautiful output and logging
Project description
@mainfile
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
Built Distribution
Close
Hashes for pycolor_palette_loguru-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3b1acaac7004656623f009b56adae6085eb93a64ed5bedcc779e6f9e87c3084 |
|
MD5 | 606da48b20c5a7bdbb3133b517047588 |
|
BLAKE2b-256 | 4c95e3a9c03c339e066315ec12fb0032e6e10e3928294d7ac5539042f4a7a235 |
Close
Hashes for pycolor_palette_loguru-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a607945c61c1d9a6e0c4fcdc5b8b850518a0eb32be25c9d63c38e4e5fd1df43 |
|
MD5 | 0f306aad55e27ec190f8e8480a8f8be5 |
|
BLAKE2b-256 | 4e1bbc24ed8c5ffe36cc879d91d880f3b056acf999f97b62cdcf6891b46ea78a |