--- id: snoop version: "0.6.1" license: MIT license_treatment: permissive maintenance: active --- # snoop — Powerful debugging tools for Python License: permissive · Maintenance: active · Downloads: 266.0K/mo ## What it is and what it does snoop is a Python debugging library that replaces manual print-statement debugging with a single decorator or context manager. Instead of scattering print calls throughout your code to track execution flow and variable changes, you annotate the function or wrap a code block with @snoop or with snoop:, and snoop logs every line that runs, the order in which they execute, and the exact moment each local variable changes value. It also includes pp, a pretty-print utility that shows both the source expression and its formatted value, useful for quick inline inspection. The package is designed for developers who want visibility into function behavior without the setup overhead of a graphical debugger. It supports watching arbitrary expressions, exploding nested data structures to see all attributes and items, and tracing into nested function calls via the depth parameter. snoop integrates with IPython and Jupyter, and can be globally installed via install() to avoid explicit imports in your code. Use it for: - Trace execution flow and variable mutations in a function without adding print statements or opening a debugger. - Inspect the values and timing of changes to complex nested data structures during a function call. - Debug a memoizing or caching decorator by watching when cache lookups succeed or fail across multiple calls. - Print intermediate values of subexpressions inline without restructuring your code, using pp() or pp.deep(). - Understand call sequences and state changes across multiple nested function calls using the depth parameter. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. snoop adds decorator-based and context-manager tracing to Python functions, logging which lines execute, when variables change, and their values—a lightweight alternative to setting up a full debugger. Yes. snoop is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real friction point in Python debugging. If you regularly reach for print-based debugging or want a faster alternative to setting up a breakpoint debugger, it's a low-risk, high-utility addition. The MIT license and broad Python version support (3.8–3.14) make it suitable for most projects. ## Install pip install snoop uv add snoop poetry add snoop ## Installing snoop Before you install: Low friction: pure Python wheel with four lightweight runtime dependencies (cheap_repr, executing, asttokens, pygments). Active maintenance—last commit 2026-07-18, 1459 repository stars—and supports Python 3.8 through 3.14. License in practice: MIT license (permissive): you can use, modify, and distribute snoop freely in both open-source and proprietary projects with minimal restrictions. Quickstart: pip install snoop import snoop @snoop def example(x): y = x + 1 return y * 2 example(5) Verify before relying: - Whether pp.deep's lambda-based subexpression tracing works reliably in all IDE/notebook environments - Performance overhead when tracing deeply nested call stacks (depth parameter behavior under load) ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 266.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags function execution tracing, debug logging decorator, variable change tracking, print debugging helper, line-by-line execution log, python debugging tools, function call inspection, debugging, introspection, development-tools [View on SkillFed](https://skillfed.io/packages/snoop) · [View on PyPI](https://pypi.org/project/snoop/)