Skip to main content

A library to print colorful

Project description

This is just a simple library to print colorful using sys.stderr to write.

from colorful_logging.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.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}")

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.7.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

colorful_logging-0.7-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file colorful_logging-0.7.tar.gz.

File metadata

  • Download URL: colorful_logging-0.7.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for colorful_logging-0.7.tar.gz
Algorithm Hash digest
SHA256 e7f48cb76242c65096cb5c1ff939d17f4acb9a187b7536bdb745a611c36a1c4c
MD5 dcdfcf0bd471f8108e1e036389060fa6
BLAKE2b-256 afe5bba4da4eb7a84ee0232765a87e7412785af43063f5a8ab9d9cfa4ccc0a13

See more details on using hashes here.

File details

Details for the file colorful_logging-0.7-py3-none-any.whl.

File metadata

  • Download URL: colorful_logging-0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for colorful_logging-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d22ad6d729d362ebdaae43e3b07c8782c5675c17f6d02d9c1e7825944b921348
MD5 d7309957ba865759cfaafdbd42de99e4
BLAKE2b-256 b305ed8680ad942a04cfed3fbff76b196f1453637414cff0ada29d50cc626ae5

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