# cool-RR/PySnooper

Never use print for debugging again

Repository: https://github.com/cool-RR/PySnooper
Canonical: https://ross.abutalabs.com/products/pysnooper
Language: Python
License: MIT
License Family: permissive
Topics: python, debug, debugger, introspection, logging
Last push: 2026-06-08T19:45:15+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 86, release rhythm 8, longevity 100
- inputs: {"age_days": 2694, "days_push": 86, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 16582, forks 961 (observed 2026-08-28T04:11:16.766785+00:00)

## What it is
PySnooper is a Python library that provides line-by-line execution tracing of functions via a simple decorator or context manager, logging which lines ran and how local variables changed. It acts as a lightweight alternative to full debuggers, replacing ad-hoc print statements with detailed execution logs.

## Use cases
- debug python code without setting up a debugger
- replace print statement debugging with a decorator
- trace which lines of a function execute and when
- log local variable changes during function execution
- redirect execution trace output to a log file
- snoop on a specific block of code with a context manager
- watch values of expressions during debugging

## When to choose
- you want quick debugging with zero setup in a large codebase
- a full debugger with breakpoints feels like overkill
- you need a play-by-play log of function execution and variable changes

## When to avoid
- you need breakpoints, stepping, or interactive debugging
- tracing would produce excessive overhead in performance-critical code
- you need multi-threaded or distributed debugging features

## Facets
- artifact type: library
- maturity: active
- function: logging, developer-tools
- domain: developer-tools
- platform: python, cross-platform
- tags: debugging, tracing, decorator, poor-mans-debugger, introspection, python

## Member repositories
- cool-RR/PySnooper (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:16.766785+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:04:51.594477+00:00, confidence not recorded.
  - readme: https://github.com/cool-RR/PySnooper (fetched 2026-08-28T04:11:16.766785+00:00, sha 5e832dc3a7b2)
  - registry_pypi: https://pypi.org/pypi/pysnooper/json (fetched 2026-08-29T08:02:07.137725+00:00, sha e246c76e7bd3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
