// the find
kennethreitz/crayons
Text UI colors for Python.
A thin wrapper around colorama that gives you named color functions returning self-resetting strings. Aimed at Python CLI tool authors who want colored output without manually writing ANSI escape sequences. It's a single-file library with a surface area you can read in five minutes.
Auto-resets to the original color after each string, so you don't concatenate a red suffix accidentally. TTY detection built in — no colors when piped, which is the correct default behavior. String length calculation works correctly, which most naive ANSI wrappers get wrong and which breaks things like progress bars and column alignment.
Abandoned since August 2020 and the original kennethreitz repo has been forked/maintained by MasterOdin, so you need to track which one is actually alive. No 256-color or true-color (RGB) support — you get the 8 basic colors and nothing else, which is limiting for any modern terminal app. colorama itself has evolved; this wrapper doesn't expose any of the newer capabilities like cursor movement. At 417 stars and a single .py file, you'd be just as well off writing this yourself in 30 lines rather than taking the dependency.