๐Ÿ“ฆ DeflateAwning / color_stream

A quick Python script to run another shell command, and color the stdout/stderr streams green/red

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ The Unlicense
๐Ÿ“ฅ Clone https://github.com/DeflateAwning/color_stream.git
HTTPS git clone https://github.com/DeflateAwning/color_stream.git
SSH git clone git@github.com:DeflateAwning/color_stream.git
CLI gh repo clone DeflateAwning/color_stream
DeflateAwning DeflateAwning Bump version 8176477 11 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .vscode
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ demo_1.py
๐Ÿ“„ LICENSE
๐Ÿ“„ pyproject.toml
๐Ÿ“„ README.md
๐Ÿ“„ README.md

color_stream

A quick Python script to run another shell command, and split/color the stdout/stderr streams green/red

Story

While working with redirecting and assessing the output from another CLI tool, I needed a way to see what was going to stderr, and what was going to stdout.

This tool highlights the two streams, in real time.

Usage

pip install color_stream

color_stream '<another command here>'
## OR ##
python3 -m color_stream '<another command here>'

# Test it with the demo script in this repo:
color_stream python demo_1.py

# Test it with "ls" (success, and error with file that doesn't exist):
color_stream ls file_that_exists.txt file_that_does_not_exist.txt

# Print out the total bytes count statistics:
color_stream --stat python demo_1.py

Limitations

  • reading from stdin is untested, and likely doesn't work
  • throughput speed is currently not benchmarked
  • switching colors is not currently supported