skillfed

icecream

Never use print() to debug again: inspect variables, expressions, and program execution with a single, simple function call.

icecream v2.2.0 2.0M downloads/30d#3,412 on PyPI10,105
Permissive license MIT Active released

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 icecream

uv

uv add icecream

poetry

poetry add icecream

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries

Tags

print debugging helperinspect variables and expressionspretty print debug outputsyntax highlighted debuggingexecution flow tracingdebug output formattingvariable inspection tool
debuggingdevelopment-toolsrepl-friendly

More Libraries packages