Style is a simple and fast Python library for styling terminal output with colors and formatting using ANSI escape codes. It provides a clean API for foreground colors, background colors, and text effects. The current version is 1.1.6, and it maintains a stable, active release cadence.
pip install styleVerified import paths — ran on the pinned version, not inferred.
This example demonstrates basic usage of `style` to apply foreground color, background color, and text effects like bold or underline to a string. The `style` function returns the styled string, which can then be printed.
Apply styles to individual components and concatenate them. For example, `print(style('Hello ', fg.red) + style('World!', fg.blue))` for distinct styling, rather than `print(style('Hello ' + style('World!', fg.blue), fg.red))` which won't apply red to 'World!'.Always use lowercase attribute names for colors and effects as defined in the `fg`, `bg`, and `ef` objects.
No dependency data recorded yet.