{"id":13478384,"url":"https://github.com/pycontribs/enrich","last_synced_at":"2025-04-04T13:07:55.579Z","repository":{"id":39621131,"uuid":"313031845","full_name":"pycontribs/enrich","owner":"pycontribs","description":"Enrich adds few missing features to the wonderful rich library.","archived":false,"fork":false,"pushed_at":"2025-03-24T16:52:59.000Z","size":83,"stargazers_count":36,"open_issues_count":5,"forks_count":11,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-28T12:03:49.352Z","etag":null,"topics":["colorama","console","pep-621","rich","terminal-colors"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pycontribs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ssbarnea"}},"created_at":"2020-11-15T12:59:40.000Z","updated_at":"2025-03-07T14:09:07.000Z","dependencies_parsed_at":"2023-12-25T18:03:52.104Z","dependency_job_id":"4e21429b-1393-421f-8b97-87da799deae1","html_url":"https://github.com/pycontribs/enrich","commit_stats":{"total_commits":49,"total_committers":5,"mean_commits":9.8,"dds":0.6122448979591837,"last_synced_commit":"6d102221429ee780d7d8185599c02b9a9c11e71d"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycontribs%2Fenrich","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycontribs%2Fenrich/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycontribs%2Fenrich/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pycontribs%2Fenrich/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pycontribs","download_url":"https://codeload.github.com/pycontribs/enrich/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247176524,"owners_count":20896487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colorama","console","pep-621","rich","terminal-colors"],"created_at":"2024-07-31T16:01:56.275Z","updated_at":"2025-04-04T13:07:55.545Z","avatar_url":"https://github.com/pycontribs.png","language":"Python","funding_links":["https://github.com/sponsors/ssbarnea"],"categories":["Python"],"sub_categories":[],"readme":"# enrich\n\nEnriched extends [rich](https://pypi.org/project/rich/) library functionality\nwith a set of changes that were not accepted to rich itself.\n\n## Console with redirect support\n\nOur Console class adds one additional option to rich.Console in order to\nredirect `sys.stdout` and `sys.stderr` streams using a FileProxy.\n\n```python\nfrom enrich.console import Console\nimport sys\n\nconsole = Console(\n    redirect=True,  # \u003c-- not supported by rich.console.Console\n    record=True)\nsys.write(\"foo\")\n\n# this assert would have passed without redirect=True\nassert console.export_text() == \"foo\"\n```\n\n## Console with implicit soft wrapping\n\nIf you want to produce fluid terminal output, one where the client terminal\ndecides where to wrap the text instead of the application, you can now\ntell the Console constructor the soft_wrap preference.\n\n```python\nfrom enrich.console import Console\nimport sys\n\nconsole = Console(soft_wrap=True)\nconsole.print(...)  # no longer need to pass soft_wrap to each print\n```\n\n## Console.print can also deal with ANSI escapes\n\nExtends Rich Console to detect if original text already had ANSI escapes and\ndecodes it before processing it. This solves the case where printing\noutput captured from other processes that contained ANSI escapes would brake.\n[upstream-404](https://github.com/willmcgugan/rich/discussions/404)\n\n## Soft-wrapping logger\n\nRich logger assumes that you always have a fixed width console and it does\nwrap logged output according to it. Our alternative logger does exactly the\nopposite: it ignores the columns of the current console and prints output\nusing a Console with soft wrapping enabled.\n\nThe result are logged lines that can be displayed on any terminal or web\npage as they will allow the client to decide when to perform the wrapping.\n\n```python\nimport logging\nfrom enrich.logging import RichHandler\n\nFORMAT = \"%(message)s\"\nlogging.basicConfig(\n    level=\"NOTSET\", format=FORMAT, datefmt=\"[%X]\", handlers=[RichHandler()]\n)\n\nlog = logging.getLogger(\"rich\")\nlog.info(\"Text that we do not want pre-wrapped by logger: %s\", 100 * \"x\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycontribs%2Fenrich","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpycontribs%2Fenrich","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycontribs%2Fenrich/lists"}