Skip to content

Latest version Python 3.10 | 3.11 | 3.12 | 3.13+ BSD-3-Clause license Codecov CodeQL Test Downloads

Colorist for Python 🌈#

What Is Colorist?#

Lightweight Python package that makes it easy and fast to print colored text in the terminal.

How It Works#

Basic Usage#

Colorist is intended to be easy to use. Imagine you want to print a mix of colors in the terminal:

% This is RED!

Once installed, simply import the colorist module and start printing colored text with the Color class:

Python
1
2
3
from colorist import Color

print(f"This is {Color.RED}RED{Color.OFF}!")

You can use the same method to apply other colors to text.

Varied Color Palette#

Or simply print a full line of colored text from a varied palette of colors:

Python
1
2
3
4
5
6
from colorist import bright_magenta, bright_yellow, blue, green

cyan("This is BLUE!")
green("This is GREEN!")
bright_magenta("This is BRIGHT MAGENTA!")
bright_yellow("This is BRIGHT YELLOW!")

How it appears in the terminal:

% This is BLUE!
% This is GREEN!
% This is BRIGHT MAGENTA!
% This is BRIGHT YELLOW!

Background Colors#

It's also possible to apply background colors to text:

Python
1
2
3
from colorist import BgColor

print(f"This is {BgColor.RED}RED{BgColor.OFF}!")

How it appears in the terminal:

% This is RED!

You can use the same method to apply other background colors to text.

Next Steps#

Ready to try more options and features? Let's get started with the installation or check out the user guide.

Become a Sponsor

If you find this project helpful, please consider supporting its development. Your donations will help keep it alive and growing. Every contribution, no matter the size, makes a difference.

Donate on GitHub Sponsors

Thank you for your support! 🙌