Skip to main content

pretty-print with color

Project description

clog

This project is now simply a shortcut for using rich.

If you want to save yourself a dependency, just use rich.

Usage

Pass any data into clog and it'll get pretty-printed.

>>> from clog import clog
>>> data = {'here': 'is some data'}
>>> clog(data)

You can also give it a title:

>>> clog(data, title="My Data")

Or change the color:

>>> clog(data, title="My Data", color="red")

Colors

This library uses rich under the hood, so it theoretically supports any color that rich supports.

Disclaimer

The clog function is now simply a wrapper around:

from rich.panel import Panel
from rich.pretty import Pretty
from rich import print

print(Panel(Pretty(msg), title=title, subtitle=subtitle, border_style=color))

So, seriously... just use rich.

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

clog-0.3.1.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file clog-0.3.1.tar.gz.

File metadata

  • Download URL: clog-0.3.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

File hashes

Hashes for clog-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3cb3899b06e6e66b539329be8ede7090017c3289dffbd63c56cdce80f1cc2a71
MD5 0d13125a4f64e1f5e81fae31a30c8f28
BLAKE2b-256 e35f19e4f988704512c5fee777f8d120aee3c4bf5ddce66124952ea82e829924

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page