Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Colorize commands output using patterns.

Project description

last release downloads python versions continuous integration test coverage gitter chat

Easily colorize commands output using patterns.

rainbow [ --COLOR=PATTERN ... | --conf CONF ] COMMAND

Examples

Using the command line

Prepend rainbow with --COLOR=PATTERN associations to your command, for example:

  • Tail some log file with lines containing ERROR in red:

    rainbow --red=ERROR tail -f /var/log/my.log
    
  • You can also pipe commands output into rainbow:

    tail -f /var/log/my.log | rainbow --red=ERROR
    

Using configs

Rainbow can load configuration for each command from files, which is the most convenient way to use it. When running rainbow mycommand, rainbow will automatically look for a config named mycommand.cfg in ~/.config/rainbow, ~/.rainbow, /etc/rainbow, or builtin configs:

  • Colorize the diff command output using the builtin config:

    rainbow diff file1 file2
    
  • Start my custom command, using ~/.rainbow/mycommand.cfg:

    rainbow mycommand
    

The syntax for writing configs is straightforward, see the builtin configs for examples. See also the commands support table.

Installation

Using packages

System Installation instructions
Debian / Ubuntu rainbow repository
Fedora / CentOS / RHEL / Scientific Linux rainbow repository
OpenSUSE / SLE rainbow repository
Arch Linux AUR/rainbow / AUR/rainbow-git
pip / easy_install PyPI: rainbow

Building from sources

You can build from sources this way:

git clone git://github.com/nicoulaj/rainbow.git
cd rainbow
python setup.py build install --user

Contributing

Contributions are welcome, please see CONTRIBUTING.

License

This project is a fork of Linibou’s colorex. It is is released under the terms of the GNU General Public License. See COPYING for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rainbow, version 2.7.1
Filename, size File type Python version Upload date Hashes
Filename, size rainbow-2.7.1-py2.py3-none-any.whl (45.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size rainbow-2.7.1.tar.gz (30.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page