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
File details
Details for the file pycolor_palette_loguru-0.1.4.tar.gz
.
File metadata
- Download URL: pycolor_palette_loguru-0.1.4.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.11.0-1-cachyos
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f7fe79f9b974fd73089c7a320bf7c33988848cc7f2ca444819cf22e20250d1f |
|
MD5 | e0acf3203dc45ed89e9232d55a32f041 |
|
BLAKE2b-256 | 9e19216ccdccc05806fd7e0806adf930c4c9d05c37f5937f719f95b7626e76ee |
File details
Details for the file pycolor_palette_loguru-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: pycolor_palette_loguru-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.11.0-1-cachyos
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2121ccc868479d434d141629e89aac0022cfb65886576613503ddc5444ef96a1 |
|
MD5 | bad8027ff29e9414f1525383a970c6f2 |
|
BLAKE2b-256 | bd40e8ca4a5b04d39e2f46844a209d6d06615aa4b7ce688bee0994d89e185256 |