Skip to main content

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

Project description

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

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

color_stream-0.3.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

color_stream-0.3.1-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file color_stream-0.3.1.tar.gz.

File metadata

  • Download URL: color_stream-0.3.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for color_stream-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1c034ef24fbf382ca1f18a30b32cfadba34e574d5809b397385ae5d313c34c4d
MD5 e4738f44d5739e8ff49a19c97b85b84d
BLAKE2b-256 9039c4665522e0a8e86da4c6d156fdfc704f67296fd666c19d9a7fcec0de08f0

See more details on using hashes here.

File details

Details for the file color_stream-0.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: color_stream-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for color_stream-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ccf77ef92abad3da3d6505462ff8b2a032da889c67bc43c13472dcc3ee6e7b06
MD5 ba3ae1e35a2736e2c11d86a57837e58d
BLAKE2b-256 90238af3bae3b4be84ea1c5817714f50ea5bb26aac2e671aa07ec1cfb94b69c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page