Skip to main content

colorize.py

There is at least one existing tool to perform automatic syntax highlighting of code and output ANSI escape sequences. Unfortunately, to the best of the author’s knowledge, there is no existing tool for highlighting lines of log files that contain a particular pattern. Vim’s match and 2match are close, but a little kludgy to use.

The purpose of this tool is to colorize lines matching a particular pattern, to make it easier to highlight relevant lines in a log file, when poring over such files with your coworker or manager.

Usage

Assume we have a file with the following contents:

This is an interesting line with some awesome content.
unrelated line
unrelated line
unrelated line
foobar
Different topic of interest
unrelated line

Then we can run the following commands to see some of effects we want:

colorize.py -h
colorize.py -l
colorize.py -f 'This is an interesting line=Blue' Input.log
colorize.py -f 'This is an interesting line=Blue' -f 'Different topic=Red' Input.log

# Note that we must run less in raw node to see the colors.
colorize.py -f 'This is an interesting line=Blue' | less -R

Metadata

Release files for colorize.py 0.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colorize.py 0.9.2
File Size Uploaded Provenance Actions
colorize_py-0.9.2.tar.gz 4.6 kB Without provenance Details for colorize_py-0.9.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for colorize.py 0.9.2
File Interpreter ABI Platform Actions
colorize_py-0.9.2-py3-none-any.whl Python 3 none any Details for colorize_py-0.9.2-py3-none-any.whl

Total release size: 11.6 kB

Release files / colorize_py-0.9.2.tar.gz

Download URL colorize_py-0.9.2.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
647a1797955d0809ecaa6f018838117790c9b05f6ad530f740424b45fc930da9
BLAKE2b-256 checksum
How to use checksums
d59e64a1b2069ed2e0f90aeac3fb0b24acee287400a5139a8b13dc1a91692295
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / colorize_py-0.9.2-py3-none-any.whl

Download URL colorize_py-0.9.2-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d720731fdb8966237f6c77bc2aac6540de3576bb807bf222fa3354a44548c70
BLAKE2b-256 checksum
How to use checksums
6aeb19663746b4161d1119e461a558126bbd35a4b4b80205d9f85c37ca45b29d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for colorize.py 0.9.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page