larzcolor
Terminal colour, done right.
ANSI terminal colours and styles that auto-disable on non-TTYs and when NO_COLOR is set — colour output that never corrupts pipes or logs.
larzscript pkg install color
What you get
- ANSI colours & styles
- Auto-disable off-TTY
- Honours NO_COLOR
- Pipe-safe
Try it
import "color" as c
print(c.green("ok") + " " + c.red("error") + " " + c.bold(c.cyan("title")))
c.set_enabled(false)
print(c.green("plain now"))Output
ok error title plain now
Why it's in the Larz Stack
larzcolor is a real Larzscript package (larzscript pkg install color) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.