Lightweight Python package that makes it easy and fast to print colored text in the terminal.
Ready to try? See how to install.
How to print a full line of colored text in the terminal:
from colorist import green, yellow, red
green("This is GREEN!")
yellow("This is YELLOW!")
red("This is RED!")How it appears in the terminal:
How to customize colors inside a paragraph and print it in the terminal:
from colorist import Color
print(f"I want {Color.RED}red{Color.OFF} color inside this paragraph")
print(f"Both {Color.GREEN}green{Color.OFF} and {Color.YELLOW}yellow{Color.OFF} are nice colors")How it appears in the terminal:
Most terminals support bright colors that stand more out:
from colorist import BrightColor
print(f"I want {BrightColor.CYAN}cyan{BrightColor.OFF} color inside this paragraph")How it appears in the terminal:
Remember to use Color.OFF or BrightColor.OFF every time you want to revert back to the default terminal text style. Otherwise, the color may spill over and into other terminal messages.
from colorist import bg_green, bg_yellow, bg_red
bg_green("This is GREEN background!")
bg_yellow("This is YELLOW background!")
bg_red("This is RED background!")How it appears in the terminal:
Background colors can also be mixed inside a paragraph:
from colorist import BgColor
print(f"I want {BgColor.RED}red{BgColor.OFF} background color inside this paragraph")
print(f"Both {BgColor.GREEN}green{BgColor.OFF} and {BgColor.YELLOW}yellow{BgColor.OFF} are nice background colors")How it appears in the terminal:
from colorist import BgBrightColor
print(f"I want {BgBrightColor.CYAN}cyan{BgBrightColor.OFF} background color inside this paragraph")How it appears in the terminal:
As with text colors, remember to use BgColor.OFF or BgBrightColor.OFF every time you want to revert back to the default terminal text style. Otherwise, the color may spill over and into other terminal messages.
If you find this project helpful, please consider supporting its development. Your donations will help keep it alive and growing. Every contribution makes a difference, whether you buy a coffee or support with a monthly donation. Find your tier here:
Thank you for your support! π
If you have suggestions or changes to the module, feel free to add to the code and create a pull request.
If you encounter any issues, you can report them as bugs or raise issues.





















































