PySnooper
A poor man's debugger for Python.
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with no runtime dependencies.
- Actively maintained with recent commits.
License · maintenance · safety
permissive license (permissive) — MIT license permits unrestricted use, modification, and distribution in both open and closed projects.
last release 2025-05-31 (440 days) · last repo commit 2026-06-08 · 16,579 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 525,918 downloads/mo, #6,182 on PyPI
Alternatives
Verify before relying
pip install pysnooper
import pysnooper
@pysnooper.snoop()
def my_function():
x = 1
y = x + 2
return y
my_function()- Actual repository star count and download volume to assess community adoption and reliability.
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 on this page. Verify before relying on it.
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
pysnooper on PyPI
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 | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 440 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 525,918 / month, #6,182 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Debuggers |
Evidence: PySnooper-1.2.3-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “line-by-line debugging”
- PySnooperPySnooper is a decorator-based debugging tool that logs function…
- memory-profilerProfiles memory consumption line-by-line in Python functions and…
- hunterHunter is a code tracing toolkit that intercepts and logs function…
Give your agent the search over MCP, or paste the wish link into any chat.
More Debuggers packages
Extracts and displays stack frame and traceback data with context-aware source code rendering, used to power enhanced tracebacks in IPython and similar tools.
Install it if you need to display or inspect stack frames with source context; skip it if your use case doesn't involve frame introspection.
debugpy is a Debug Adapter Protocol implementation for Python that enables remote debugging of Python scripts and modules through standard DAP clients, with support for breakpoints, exception handling, and subprocess debugging.
Install it if you need remote debugging, DAP client integration, or programmatic control over breakpoints and exception handling.
Pylint is a static code analyzer that checks Python code for errors, enforces coding standards, detects code smells, and suggests refactoring improvements without executing the code.
Install it if you need thorough code analysis with inference-based bug detection; if speed is critical, consider pairing it with faster linters like ruff for…
yamllint checks YAML files for syntax errors, style violations, and structural problems like key repetition, line length, trailing spaces, and indentation issues.
ipdb is an IPython-enabled debugger that replaces Python's standard pdb with tab completion, syntax highlighting, and better introspection while maintaining the same pdb interface.
Memray is a memory profiler for Python that traces every function call to track memory allocations across Python code, native extensions, and the interpreter itself, generating reports like flame graphs and tables to analyze memory usage.
See also snoop · Autologging · devtools · pydevd-pycharm · pydevd · memory-profiler · pudb · line-profiler · aiodebug · icecream