termcolor
ANSI color formatting for output in terminal
Decision gist · record as of 2026-08-14
Yes. termcolor is a stable, actively maintained library with zero dependencies, permissive licensing, and broad terminal support. It solves a common problem (colored terminal output) with a simple API. Install it if you need ANSI color formatting in any Python CLI, script, or logging system.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel with no runtime dependencies.
- Actively maintained as of 2026-08-01 with recent release on 2025-12-29.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2025-12-29 (228 days) · last repo commit 2026-08-01 · 326 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 105,554,813 downloads/mo, #328 on PyPI
Alternatives
Verify before relying
pip install termcolor
from termcolor import colored, cprint
print(colored("Hello", "red", attrs=["bold"]))
cprint("World", "green", "on_red")- Whether RGB tuple support (0-255 integers) works consistently across all supported terminal types listed in the documentation.
What it is and what it does
termcolor is a lightweight Python library that wraps terminal output with ANSI escape codes to add colors and text attributes like bold, italic, underline, blink, and reverse video. It provides two main functions: `colored()` returns a formatted string, and `cprint()` prints directly with formatting applied. The library supports named colors (red, green, blue, etc.), background colors (on_red, on_green, etc.), and arbitrary RGB colors as tuples.
The package automatically detects terminal capabilities and disables color output when appropriate (dumb terminals, piped output, or when explicitly disabled via environment variables like NO_COLOR or ANSI_COLORS_DISABLED). It respects standard conventions like FORCE_COLOR for forcing color output. With no external dependencies and pure Python implementation, it integrates easily into CLI tools, logging systems, and any script that needs readable colored output.
Use it for
- Highlight error messages in red and warnings in yellow within CLI applications or scripts.
- Add visual distinction to log output by coloring different severity levels (debug, info, error).
- Create colorful progress indicators or status displays in terminal-based tools.
- Format test output to show passing tests in green and failures in red.
- Build interactive CLI menus or prompts with colored text for better user experience.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
termcolor is a stable, actively maintained library with zero dependencies, permissive licensing, and broad terminal support. It solves a common problem (colored terminal output) with a simple API. Install it if you need ANSI color formatting in any Python CLI, script, or logging system.
Install
termcolor on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of 2026-08-01 with recent release on 2025-12-29.
Requires Python 3.10 or later.
License in practice
MIT license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install termcolor
from termcolor import colored, cprint
print(colored("Hello", "red", attrs=["bold"]))
cprint("World", "green", "on_red")
Verify before relying
- Whether RGB tuple support (0-255 integers) works consistently across all supported terminal types listed in the documentation.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 228 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,554,813 / month, #328 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: TerminalsTyping :: Typed |
Evidence: termcolor-3.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ANSI color formatting”
- termcolorAdds ANSI color and text formatting (bold, underline, blink, reverse,…
- tcolorpyApplies ANSI true color and text styles (bold, italic, underline,…
- strip-ansiRemoves ANSI escape sequences (color codes, formatting directives)…
Give your agent the search over MCP, or paste the wish link into any chat.
More Terminals packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Rich renders styled text, tables, progress bars, syntax highlighting, markdown, and tracebacks to the terminal with minimal code.
Colorama makes ANSI escape sequences for colored terminal text work on Windows by intercepting and converting them to win32 API calls, while passing through unchanged on other platforms.
Install it if you need colored terminal output to work on Windows or want to use ANSI-based libraries portably; skip it only if you target non-Windows platforms…
Measures the displayed width of Unicode strings in terminals, accounting for wide characters, combining marks, and terminal escape sequences that standard Python string functions mishandle.
Install it if your application formats text for terminals and handles non-ASCII characters.
Run a subprocess in a pseudo terminal (pty) and interact with its input and output, enabling automation of interactive programs that require terminal features like password prompts or curses-style interfaces.
However, note that it is aging (last release 2020-12-28) and not actively maintained; it works well for its narrow, well-defined purpose but won't receive updates for…
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
See also ansimarkup · colorlog · simple-colors · sparklines · tcolorpy · log-symbols · ascii-colors · colorclass · style