Colory PPrint is your new best friend when it comes to logging in Python—especially if you like your logs colorful, stylish, and super readable! Say goodbye to bland, hard-to-read logs and hello to clean, color-coded JSON logs with all the bells and whistles. Plus, it’s got your back when logging things that Python doesn't like to serialize.
Project description
Colory PPrint
Colory PPrint is your new best friend when it comes to logging in Python—especially if you like your logs colorful, stylish, and super readable! Say goodbye to bland, hard-to-read logs and hello to clean, color-coded JSON logs with all the bells and whistles. Plus, it’s got your back when logging things that Python doesn't like to serialize.
Features:
- 🎨 Color-coded JSON logs: Pick your foreground and background colors for that perfect contrast.
- ✨ Text styles: Bold, underline, reverse, and even concealed—make your logs pop!
- 🔧 Customizable: Tweak the logging to your heart’s content, perfect for debugging and visualizing data.
- 🧩 Handles non-serializable objects: Logs things like custom classes by showing their type and memory address. Nothing gets left behind.
Installation
Getting Colory PPrint up and running is a breeze! Choose one of these two methods:
-
From the GitHub repo directly:
pip install git+https://github.com/ruhiddin/colory-pprint.git
-
Alternatively, from PyPI (because we’re all about simplicity):
pip install colory_pprint
Usage
Basic Usage:
Start logging with a simple import and one-liner. Like magic.
from colory_pprint import ColoryPPrint
log = ColoryPPrint(debug=True)
log({"message": "Hello, World!"})
Logging with Colors and Styles:
Why stick to plain text when you can have colorful, styled logs?
log.red.bold({"status": "error", "message": "Oops! Something went wrong."})
log.green.on_black.underline({"status": "success", "message": "All systems go!"})
Handling Non-Serializable Objects:
Got an object that Python doesn’t know how to handle? No worries. Colory PPrint logs it with style anyway, using the repr() function.
class CustomObject:
def __init__(self, name: str, value: int):
self.name = name
self.value = value
custom_obj = CustomObject(name="Test", value=100)
log.red.bold({
"status": "error",
"message": "Something failed!",
"object": custom_obj
})
The output will look something like this:
{
"status": "error",
"message": "Something failed!",
"object": "<CustomObject object at 0x7f8a3f8b93d0>"
}
Available Colors:
Foreground: black, red, green, yellow, blue, magenta, cyan, white, grey, light_red, light_green, light_yellow, light_blue, light_magenta, light_cyan, light_white.
Background: on_black, on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white, on_grey, on_light_red, on_light_green, on_light_yellow, on_light_blue, on_light_magenta, on_light_cyan, on_light_white.
Available Text Styles:
- bold
- underline
- reverse
- concealed
Debug Mode:
Got some tricky bugs? Turn on debug mode to see all the inner workings of your logging.
log = ColoryPPrint(debug=True)
log({"message": "Debug mode: ON! See everything in style."})
(Just remember to switch it off in production, unless you want your logs to throw a party.)
Now go on, add some color to those logs, and make debugging feel like a breeze!
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
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 colory_pprint-1.5.0.tar.gz.
File metadata
- Download URL: colory_pprint-1.5.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c570b4759883ce950b13d2f2f1dd77b7e531bdd0f276609be6e0758bb1c8246
|
|
| MD5 |
1bd9f4c29119a075b8bdf646cd406331
|
|
| BLAKE2b-256 |
c6b13abe3963342c041f2f5d34ab1e490f7bea0be382f573f20cf3ab5d3db9fc
|
Provenance
The following attestation bundles were made for colory_pprint-1.5.0.tar.gz:
Publisher:
release.yml on Ruhiddin/colory-pprint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colory_pprint-1.5.0.tar.gz -
Subject digest:
2c570b4759883ce950b13d2f2f1dd77b7e531bdd0f276609be6e0758bb1c8246 - Sigstore transparency entry: 702337565
- Sigstore integration time:
-
Permalink:
Ruhiddin/colory-pprint@80b0198969fee5ac551bee20d55b970e080f32f4 -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/Ruhiddin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80b0198969fee5ac551bee20d55b970e080f32f4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file colory_pprint-1.5.0-py3-none-any.whl.
File metadata
- Download URL: colory_pprint-1.5.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a83e4a312d0813620f4efc2d26740f780d636e232dbfaaf469b0cbb81ef897ea
|
|
| MD5 |
1433a7dfb6e3235e8fbe218e31ab9991
|
|
| BLAKE2b-256 |
8ee1d99df3549ddc5e4522054127cb24acb1b23a9f4f1f757e95658f5b0dc5b5
|
Provenance
The following attestation bundles were made for colory_pprint-1.5.0-py3-none-any.whl:
Publisher:
release.yml on Ruhiddin/colory-pprint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colory_pprint-1.5.0-py3-none-any.whl -
Subject digest:
a83e4a312d0813620f4efc2d26740f780d636e232dbfaaf469b0cbb81ef897ea - Sigstore transparency entry: 702337566
- Sigstore integration time:
-
Permalink:
Ruhiddin/colory-pprint@80b0198969fee5ac551bee20d55b970e080f32f4 -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/Ruhiddin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80b0198969fee5ac551bee20d55b970e080f32f4 -
Trigger Event:
push
-
Statement type: