This is just a simple library to print colorful using sys.stderr to write.
from colorful_logging.colorful_logging import color_print, c_print
# color_print(*values: tuple[Any, ...])
# c_print(*values: tuple[Any, ...])
# ['red', 'green', 'yellow', 'blue', 'pink', 'cyan', 'gray', 'black', 'dark red', 'dark green', 'dark yellow', 'dark blue', 'dark pink', 'dark cyan', 'bright black', 'underline']
l = [1, 2, 3]
# === FOR EXAMPLE === #
color_print('ali is good', l, 'cyan')
# will produce (with colored text):
# ali is good [1, 2, 3]
c_print(l, 'sample text', 'green')
# will produce (with colored text):
# [1, 2, 3] sample text
If your input color not found, function will print the color name. for example:
from colorful_logging.colorful_logging import color_print, c_print
color_print('ali is good', 'cyann')
# will produce
# ali is good cyann
To get specific color:
from colorful_logging.colorful_logging import get_color
c = get_color("dark blue")
r = get_color("reset")
text = f"hello {c}Ali{r}"
print(text)
You can also colorize you object:
from colorful_logging.colorful_logging import colorize
p = Person(name="ali", age=18)
colorized_elem = colorize("pink", p)
print(f"hello {colorized_elem}")
Possible colors:
['red', 'green', 'yellow', 'blue', 'pink', 'cyan', 'gray', 'black', 'dark red', 'dark green', 'dark yellow', 'dark blue', 'dark pink', 'dark cyan', 'bright black', 'underline']
Metadata
Release files for colorful-logging 0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| colorful_logging-0.9.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| colorful_logging-0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / colorful_logging-0.9.tar.gz
| Download URL | colorful_logging-0.9.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdf2802595d222ccbb671a00c026cf429181e67f39a51a298c97ebc7678f96b3
|
|
BLAKE2b-256 checksum How to use checksums |
470292555aa8146cf2bbdfad22fa5386959d7edce615739eb6495399946da0ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / colorful_logging-0.9-py3-none-any.whl
| Download URL | colorful_logging-0.9-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d0003e5aeba13e746b5f7eee90e6a222b7f2dd00c56efa30ec22b59e5d1a937
|
|
BLAKE2b-256 checksum How to use checksums |
655e92289e5b9ab10a2f00109096bdbf0641be74ff80a876f539a9a8a96633f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|