{"id":21433475,"url":"https://github.com/clobrano/raffaello","last_synced_at":"2025-07-14T13:31:14.424Z","repository":{"id":26989659,"uuid":"30453517","full_name":"clobrano/raffaello","owner":"clobrano","description":"Powerful, yet simple to use, shell command output colorizer in Python","archived":false,"fork":false,"pushed_at":"2022-12-05T10:00:30.000Z","size":1917,"stargazers_count":21,"open_issues_count":3,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-04T16:06:39.866Z","etag":null,"topics":["command-line-tools","python"],"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/clobrano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-07T11:18:32.000Z","updated_at":"2024-10-16T08:14:41.000Z","dependencies_parsed_at":"2023-01-14T05:45:24.590Z","dependency_job_id":null,"html_url":"https://github.com/clobrano/raffaello","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clobrano%2Fraffaello","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clobrano%2Fraffaello/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clobrano%2Fraffaello/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clobrano%2Fraffaello/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clobrano","download_url":"https://codeload.github.com/clobrano/raffaello/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225980903,"owners_count":17554919,"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":["command-line-tools","python"],"created_at":"2024-11-22T23:28:27.288Z","updated_at":"2024-11-22T23:28:27.867Z","avatar_url":"https://github.com/clobrano.png","language":"Python","funding_links":["https://www.paypal.me/clobrano/5"],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/raffaello.svg)](https://badge.fury.io/py/raffaello)\n[![Build Status](https://travis-ci.org/clobrano/raffaello.svg?branch=master)](https://travis-ci.org/clobrano/raffaello)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/clobrano/5)\n\nRaffaello - output colorizer\n============================\n\nRaffaello colorizes the output stream of any command-line tool (e.g. gcc/g++, cmake, dmesg, syslog and custom), making it easier to read.\n\n## Usage\n\nThe raffaello's command line interface let you use two call modes: **pipes** and **command**.\n\nIn pipe mode you call raffaello like:\n\n    \u003coutput stream source\u003e | raffaello [options]\n\nIn command mode raffaello will call your stream source in your behalf\n\n    raffaello [options] -c \u003coutput stream source\u003e\n\n\nTo highlight the output stream, Raffaello has **2 color modes** and **2 styles modes**:\n\nColor modes:\n\n- **8 colors** mode let you use the following names: *black, red, green, yellow, blue, magenta, cyan, light_gray*. **NEW** Starting from version 3.0.3 Raffaello introduces a *blind* color: *lines matching the pattern with color \"blind\" will be REMOVED from the stream*. This will improve readability of dense stream output.\n\n- **256 colors** mode let you use other 248 colors and choose between foreground or background colors (you can mix 8 colors mode names with 256 color mode names):\n\nColor styles:\n\n- Foreground color names are in the form `colorNUM`. E.g. foreground red is *color001*\n- Background color names are in the form `bgcolorNUM`. E.g. background red is *bgcolor001*\n\nWith the styles you can blend colors in **bold** and **underlined**\n\n- foreground red bold is *color001_bold*\n- foreground red underlined is *color001_underlined*\n\nCall `raffaello -l` to see the complete list of available colors.\n\n\n### Full interface description\n\n```\nUsage: raffaello (-p PRESET | -r REQUEST | -f FILE | -l) [options]\n\n    -p PRESET, --preset=PRESET              Prebuilt config files for coloring known output streams (gcc/g++, cmake, dmesg, gcc/g++, ModemManager, logcat...)\n    -r REQUEST --request=REQUEST            The requested text/color mapping string. Multipe requests are separated by a space. Regular expression are supported. E.g. \"error=\u003ered [Ww]arning=\u003eyellow_bold\".\n    -f FILE --file=FILE                     Path to the custom text=\u003ecolor configuration file.\n    -c COMMAND --command=COMMAND            Instead of using raffaello with pipes, set the command-line tool to be executed by raffaello directly. E.g. -c \"dmesg -w\".\n    -m, --match-only                        Print only the lines that match against some defined pattern.\n    -d DELIMITER --delimiter=DELIMITER      If you don't like \"=\u003e\" as delimiter between text and color, use this flag to change it. E.g. -d \u0026 [default: =\u003e]\n    -l, --list                              List all the available colors and presets\n    -v --verbose                            Enable debug logging\n```\n\n**NEWS**\n- version 3.0.3 --match-only flag Print only the lines that match against any defined pattern.\n\n## Examples\n\nThe simpler usage is using the `request` flag. The `request` flag requires a string in the form \"text=\u003ecolor anothertext=\u003eanothercolor\", where text can be a constant string or a [Regular expression](https://docs.python.org/2/library/re.html), while color is the name of the color to use (see [Usage](#Usage) section)\n\n* Simple constant text highlight\n\n        $ ifconfig eno1 | raffaello --request=\"collisions=\u003eblue\"\n\n![example001](./examples/raffaello001.png)\n\n* Highlight of multiple texts. Here you can see that spaces in the \"text part\" are not allowed. Use \\s instead.\n\n        $ ifconfig eno1 | raffaello --request=\"RX\\spackets=\u003egreen TX\\spackets=\u003ered\"\n\n![example002](./examples/raffaello002.png)\n\n* Highlight with regular expressions\n\n        $ ifconfig eno1 | raffaello --request=\"\\d+\\.\\d+\\.\\d+\\.\\d+=\u003egreen_bold\"\n\n![example003](./examples/raffaello003.png)\n\n\nFor more complex color mapping you can write a file with a line for each *text=\u003ecolor* entry, like the following\n\n    collisions=\u003eblue\n    RX\\spackets=\u003egreen\n    TX\\spackets=\u003ered\n    \\d+\\.\\d+\\.\\d+\\.\\d+=\u003egreen_bold\n\nsave the file and provide it to raffaello using its fullpath\n\n    $ ifconfig eno1 | raffaello --file=$HOME/colorfile\n\n![example004](./examples/raffaello004.png)\n\nColor files can be reused in other color files using the `include` directive followed by the fullpath to the file.\n\nUsing fullpath is annoying, tough, so Raffaello has a special path under $HOME/.raffaello. All the colorfiles inside this folder can be passed using simply their filename, without the path.\n\n    # include custom colorfile in $HOME/.raffaello\n    include some_custom_colorfile\n    \n    # include custom color outside $HOME/.raffaello\n    include $HOME/path/to/some_other_custom_color\n\n    collisions=\u003eblue\n    RX\\spackets=\u003egreen\n    TX\\spackets=\u003ered\n    \\d+\\.\\d+\\.\\d+\\.\\d+=\u003egreen_bold\n\n\nRaffaello provides some built-in colorfiles, called **presets**, for known tools like cmake, gcc/g++, dmesg, etc.\nThe presets can be used alone using `--preset` flag or even included in custom colorfile in order to extend their colormaps.\n\n    # Include a preset colorfile\n    include errors\n    \n    # include custom colorfile in $HOME/.raffaello\n    include some_custom_colorfile\n    \n    # include custom color outside $HOME/.raffaello\n    include $HOME/path/to/some_other_custom_color\n\n    collisions=\u003eblue\n    RX\\spackets=\u003egreen\n    TX\\spackets=\u003ered\n    \\d+\\.\\d+\\.\\d+\\.\\d+=\u003egreen_bold\n\nFor a full list of presets, call `raffaello --list`.\n\n\n## Raffaello is a python module\n\nRaffaello can be used as a python module inside other source codes\n\n```python\nfrom raffaello import Raffaello, Commission\n\nrequest = '''\nerror=\u003ered\nwarning=\u003eyellow_bold\nbluish\\stext=\u003ecolor026\n'''\n\nc = Commission(request)\nr = Raffaello(c.commission)\n\nprint(r.paint('Sample message with error, warning and a bluish text.'))\n```\n\n## Install\n\nInstall from source using setuptools. Just type the following command\n\n    # python setup.py install\n\nInstall from [PyPI - the Python Package Index](https://pypi.python.org/pypi)\n\n    # pip install raffaello\n\n\n## Dependencies\n\n* `docopt` language for description of command-line interfaces\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclobrano%2Fraffaello","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclobrano%2Fraffaello","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclobrano%2Fraffaello/lists"}