A library to print colorful
Project description
This is just a simple library to print colorful using sys.stderr to write.
from colorful_logging import color_print
# color_print(
# text: str = your text
# color: str = 'red', 'blue', ...
# fmt: bool = True or False
# lvl: str -> it's just a simple naming when using the "fmt=True"
# )
# for example:
color_print(
text='ali is good',
color='cyan',
fmt=True,
lvl='ALI LEVEL'
)
# will produce (with colored text):
# ALI LEVEL 24-02-06 18:49:15, File "where the color print executed", Line 1, in "the module", msg: ali is good
# here also you can use it without formatting the line:
color_print('ali is good', 'bold')
To get specific color:
from 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 import colorize
p = Person(name="ali", age=18)
colorized_elem = colorize("pink", p)
print(f"hello {colorized_elem}")
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
colorful_logging-0.6.tar.gz
(1.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file colorful_logging-0.6.tar.gz.
File metadata
- Download URL: colorful_logging-0.6.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5181afc93bfa813fb53250699144dd5a3bc7572eebb232e5ad254398be511c40
|
|
| MD5 |
543f62ed9c24a74f3a84fac1eb776905
|
|
| BLAKE2b-256 |
35126e1e73d237dbcf62f1d88169a4fe19c05eb8b8c5663ae0b15ac7bc7eaaf1
|
File details
Details for the file colorful_logging-0.6-py3-none-any.whl.
File metadata
- Download URL: colorful_logging-0.6-py3-none-any.whl
- Upload date:
- Size: 1.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec9166a408a5d3690b0b6807727e906e5c7c6ce2f1dc541dfdc3468e628f39bd
|
|
| MD5 |
60eba27b75fa69b58f1e6f814b63c416
|
|
| BLAKE2b-256 |
db7dd4a9e4f14afade2b84991304fcb7a0d5bb22de54cf8189e4d5d52ddc3c66
|