--- id: pysnooper version: "1.2.3" license: unclear license_treatment: permissive maintenance: active --- # PySnooper — A poor man's debugger for Python. License: permissive · Maintenance: active · Downloads: 525.9K/mo ## What it is and what it does PySnooper is a lightweight debugging decorator that replaces ad-hoc print statements with structured execution logging. When you decorate a function with @pysnooper.snoop(), it automatically logs every line executed, the order in which they run, and the exact moment each local variable changes. The output goes to stderr by default but can be redirected to a file or custom stream. It's designed for situations where setting up a full debugger feels like overkill—you just want to see what your code is actually doing. You can trace entire functions or wrap specific code blocks in a context manager. It supports watching arbitrary expressions beyond just local variables and can follow execution into called functions via a depth parameter. Use it for: - Trace execution flow through a complex function to understand control flow without a debugger. - Log variable state changes during development to catch unexpected mutations or initialization bugs. - Debug legacy or enterprise code where attaching a debugger is impractical or slow. - Inspect function behavior in production-like environments by redirecting output to a log file. - Watch specific expressions like object attributes or dictionary keys during execution. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PySnooper is a decorator-based debugging tool that logs function execution line-by-line, showing which lines run and how local variables change, without requiring debugger setup. Yes. PySnooper is a zero-friction, actively maintained tool with no dependencies and a permissive license. It solves a real debugging workflow gap—faster than print debugging, simpler than a full debugger setup. Install it if you debug Python code interactively. ## Install pip install pysnooper uv add pysnooper poetry add pysnooper ## Installing PySnooper Before you install: Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits. License in practice: MIT license permits unrestricted use, modification, and distribution in both open and closed projects. Quickstart: pip install pysnooper import pysnooper @pysnooper.snoop() def my_function(): x = 1 y = x + 2 return y my_function() Verify before relying: - Actual repository star count and download volume to assess community adoption and reliability. ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 525.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags function execution tracing, line-by-line debugging, variable change logging, decorator-based debugger, execution flow visualization, debug without breakpoints, function call inspection, debugging, development-tools, logging [View on SkillFed](https://skillfed.io/packages/pysnooper) · [View on PyPI](https://pypi.org/project/pysnooper/)