ansy (pronounced ANSI), inspired by termcolor, is a lightweight python library used to style and format output in the terminal.
- Easy text coloring and styling using intuitive functions
- Support for 4-bit, 8-bit, and 24-bit (truecolor) color modes
- Gradients, palettes, and random color generation
- Cross-platform support (Windows, Linux, macOS)
Ansy is available on PyPI and can be installed with pip.
pip install ansyor Install from source:
git clone https://github.com/anas-shakeel/ansy.git
cd ansy
pip install .You may also need to install colorama (Windows users only).
from ansy import colored
print(colored("Hello, World!", fgcolor="cyan", bgcolor="black", attrs=["bold"]))OR
from ansy import colored_gradient
print(colored_gradient(text, "#00ffff", "#b00b1e"))Full documentation is available here
Contributions are welcome! Check out the contributing guide to get started.
This package has been well-tested across three major platforms (Windows, MacOS, and Linux/ubuntu).
It supports Python versions 3.8 upto 3.13. it may or may not work on other versions. See more
Made with ❤️ to make your terminal output more beautiful.
