Skip to main content

enrich

Project description

enrich

Enriched extends rich library functionality with a set of changes that were not accepted to rich itself.

Console with redirect support

Our Console class adds one additional option to rich.Console in order to redirect sys.stdout and sys.stderr streams using a FileProxy.

from enrich.console import Console
import sys

console = Console(
    redirect=True,  # <-- not supported by rich.cosole.Console
    record=True)
sys.write("foo")

# this assert would have passed without redirect=True
assert console.export_text() == "foo"

Console with implicit soft wrapping

If you want to produce fluid terminal output, one where the client terminal decides where to wrap the text instead of the application, you can now tell the Console constructor the soft_wrap preference.

from enrich.console import Console
import sys

console = Console(soft_wrap=True)
console.print(...)  # no longer need to pass soft_wrap to each print

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

enrich-1.0.tar.gz (11.6 kB view hashes)

Uploaded Source

Built Distribution

enrich-1.0-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

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