crayons
TextUI colors for Python.
What it is and what it does
Crayons is a lightweight wrapper around colorama that simplifies colored terminal output in Python. It provides named color functions (red, green, yellow, blue, black, magenta, cyan, white) that automatically wrap text in the appropriate ANSI codes and reset the terminal state afterward, eliminating the need to manually manage color state. The package detects whether output is going to a TTY and suppresses colors when piped, and it correctly calculates string length for colored output.
The package is powered by colorama and has a single runtime dependency. It supports Python 2.7 and Python 3.4 through 3.8 according to its classifiers. Since its last release in 2020, the project is no longer actively maintained, though the core functionality remains stable for basic terminal coloring tasks.
Use it for:
- Add colored output to CLI tools and scripts for better readability and user feedback
- Highlight errors, warnings, and success messages in terminal applications with distinct colors
- Create visually distinct log output or status reports in command-line utilities
- Build interactive terminal UIs where color improves navigation and information hierarchy
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Crayons provides colored text output for terminal applications by wrapping strings in ANSI color codes and automatically resetting to the original state afterward.
Yes, if you need simple terminal colors and don't require active maintenance. Crayons is lightweight, has no complex dependencies beyond colorama, and works reliably for basic colored output. However, the abandoned status means no bug fixes or Python version updates will be released—use it only if you're comfortable with a stable but unmaintained package, or if you're targeting Python versions it already supports.
Install
crayons on PyPI
pip
pip install crayonsuv
uv add crayonspoetry
poetry add crayonsInstalling crayons
Before you install
Installation is straightforward with low friction. The package is abandoned as of 2020-08-26, so no active maintenance is expected, though it remains stable for basic terminal color use.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
pip install crayons
import crayons
print(crayons.red('red text'))
print(crayons.green('green text'))
print(crayons.blue('blue text'))
Verify before relying
- Whether the package works reliably with Python versions beyond 3.8 (classifiers list 3.8 as the latest tested version)
- Current compatibility with modern versions of colorama, its sole runtime dependency
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — colorama |
| Maintenance | abandoned — 2,179 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 500,822/month — #6,319 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: crayons-0.4.0-py2.py3-none-any.whl
Tags
More Terminals packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
richRich renders styled text, tables, progress…
permissive · top 100 on PyPI
coloramaColorama makes ANSI escape sequences for…
permissive · top 100 on PyPI
wcwidthMeasures the displayed width of Unicode strings…
permissive · top 1,000 on PyPI
ptyprocessRun a subprocess in a pseudo terminal (pty) and…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
histoprintHistoprint renders NumPy histograms and…
permissive · top 15,000 on PyPI
simple-colorsAdds colored and styled text output to terminal…
unclear · top 15,000 on PyPI
wasabiWasabi provides lightweight console printing…
permissive · top 5,000 on PyPI
ansi2htmlConverts terminal output with ANSI color codes…
copyleft · top 5,000 on PyPI
pastelPastel adds colored text output to terminal…
permissive · top 5,000 on PyPI
terminaltexteffectsRenders animated visual effects for text…
permissive · top 15,000 on PyPI
colorclassProvides ANSI color text output for console…
permissive · top 5,000 on PyPI
colored-tracebackAutomatically colors Python exception…
permissive · top 5,000 on PyPI
curtsiesCurtsies provides a Python library for building…
permissive · top 15,000 on PyPI
ascii-colorsUnified terminal UI library providing colored…
permissive · top 15,000 on PyPI