colored-traceback
Automatically color uncaught exception tracebacks
What it is and what it does
Colored Traceback hooks into Python's exception display system to apply syntax highlighting and color to uncaught exception tracebacks, making them significantly easier to scan visually in the terminal. The package works by intercepting the default traceback formatter and applying color via pygments for syntax highlighting and colorama for cross-platform terminal support (especially on Windows, which lacks native ANSI escape sequence support).
You can activate it with a single import statement in your script or REPL, either as a one-liner (import colored_traceback.auto) or with explicit control (colored_traceback.add_hook()). It respects whether stderr is being piped to another process, suppressing color by default unless you explicitly pass always=True. The package also supports being run as a module wrapper (python -m colored_traceback somefile.py) to color tracebacks from external scripts without modifying them.
Use it for:
- Debugging scripts interactively in the terminal where colored, visually distinct stack traces reduce cognitive load when scanning for the error origin.
- Adding to a development environment startup file to automatically color all uncaught exceptions without modifying individual scripts.
- Running third-party Python scripts with colored output by wrapping them (python -m colored_traceback script.py) without source modification.
- Making exception output in CI/CD logs or terminal sessions more readable when reviewing test failures or production errors.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Automatically colors Python exception tracebacks in the terminal to make them easier to read and scan visually.
Yes, if you spend time debugging in the terminal. It's a low-friction, zero-configuration enhancement that makes exception tracebacks genuinely easier to read. The dormant maintenance is not a concern for a simple, stable utility—no security vulnerabilities are known, and the two dependencies (pygments, colorama) are mature and widely used. Install it if visual clarity in error output matters to your workflow.
Install
colored-traceback on PyPI
pip
pip install colored-tracebackuv
uv add colored-tracebackpoetry
poetry add colored-tracebackInstalling colored-traceback
Before you install
Low friction install with two lightweight runtime dependencies (pygments and colorama). Maintenance is dormant—last release was 2024-07-13, but the repository remains active and has not been archived.
License in practice
ISC license is permissive and poses no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install colored-traceback
import colored_traceback
colored_traceback.add_hook()
# Or for a one-liner:
import colored_traceback.auto
Verify before relying
- Whether the package works correctly with modern Python versions beyond 3.3, given the dormant maintenance status and age of classifiers.
Package facts
| License | ISC (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pygments, colorama |
| Maintenance | dormant — 762 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 858,542/month — #4,881 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: colored_traceback-0.4.2-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
traceriteFormats Python exceptions and tracebacks into…
permissive · top 5,000 on PyPI
coloredColored provides ANSI/VT100 escape sequences…
permissive · top 5,000 on PyPI
stackprinterReplaces Python's default exception traceback…
permissive · top 15,000 on PyPI
crayonsCrayons provides colored text output for…
permissive · top 15,000 on PyPI
pastelPastel adds colored text output to terminal…
permissive · top 5,000 on PyPI
colorlogAdds colored output to Python's standard…
permissive · top 1,000 on PyPI
autopageAutomatically pipes terminal output to a pager…
permissive · top 5,000 on PyPI
termcolorAdds ANSI color and text formatting (bold,…
permissive · top 1,000 on PyPI
colorclassProvides ANSI color text output for console…
permissive · top 5,000 on PyPI
icecreamIceCream provides a drop-in replacement for…
permissive · top 5,000 on PyPI