icecream
Never use print() to debug again: inspect variables, expressions, and program execution with a single, simple function call.
What it is and what it does
IceCream is a debugging utility that replaces manual print() statements with a smarter ic() function. When called with arguments, ic() prints both the expression and its evaluated value; when called without arguments, it prints the filename, line number, and parent function name. The output is automatically syntax highlighted and pretty-printed, making it faster and clearer than writing print("var:", var) by hand.
The package depends on colorama for cross-platform terminal colors, pygments for syntax highlighting, executing to introspect the calling code, and asttokens to map AST nodes back to source text. It supports Python 3 and PyPy3, integrates into builtins for global availability, and can be configured to redirect output to logging systems or custom handlers. The function returns its arguments, so ic() can be inserted into existing expressions without breaking them.
Use it for:
- Quickly inspect variable values during development without typing verbose print statements with labels
- Trace execution flow by inserting ic() calls to see which code paths run and in what order
- Debug complex expressions by wrapping them in ic() to see both the code and result with syntax highlighting
- Integrate debugging output with logging systems using ic.configureOutput() and ic.format()
- Temporarily disable all debug output with ic.disable() and ic.enable() without removing ic() calls
- Inspect nested data structures with automatic pretty-printing instead of manually formatting them
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
IceCream provides a drop-in replacement for print() debugging that automatically displays variable names, expressions, and their values with syntax highlighting and optional execution context.
Yes. IceCream is actively maintained, permissively licensed, has no known vulnerabilities, and low install friction. It genuinely improves the print-debugging workflow for developers who already use that pattern. Install it if you debug with print statements; skip it only if you use a dedicated debugger exclusively.
Install
icecream on PyPI
pip
pip install icecreamuv
uv add icecreampoetry
poetry add icecreamInstalling icecream
Before you install
Low friction: pure Python wheel with four lightweight runtime dependencies (colorama, pygments, executing, asttokens). Actively maintained with recent releases; last commit 2026-08-10 and 10105 repository stars indicate ongoing support.
License in practice
MIT license (permissive) means you can use, modify, and distribute icecream freely in commercial and private projects with minimal restrictions.
Quickstart
from icecream import ic
def foo(i):
return i + 333
ic(foo(123))
# Output: ic| foo(123): 456
Verify before relying
- Whether the 60% typing speed improvement claim is measurable in typical workflows
- Performance overhead of syntax highlighting and AST inspection during debugging sessions
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — colorama, pygments, executing, asttokens |
| Maintenance | actively maintained — 133 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,953,600/month — #3,412 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: icecream-2.2.0-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
snoopsnoop adds decorator-based and context-manager…
permissive · top 15,000 on PyPI
objprintobjprint provides functions to print Python…
permissive · top 5,000 on PyPI
pykdebugparserParses Darwin kdebug trace events from iOS and…
permissive · top 15,000 on PyPI
executingIdentifies the AST node currently being…
permissive · top 1,000 on PyPI
colored-tracebackAutomatically colors Python exception…
permissive · top 5,000 on PyPI
varnameRetrieves variable names at runtime from inside…
permissive · top 15,000 on PyPI
PySnooperPySnooper is a decorator-based debugging tool…
permissive · top 15,000 on PyPI
py-expression-evalParses and evaluates mathematical expressions…
permissive · top 15,000 on PyPI
devtoolsProvides a `debug()` function that prints…
permissive · top 5,000 on PyPI
traceriteFormats Python exceptions and tracebacks into…
permissive · top 5,000 on PyPI