cool-rr/pysnooper

Never use print for debugging again

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 32 minutes ago
Added to GitGenius on September 3rd, 2026
Created on April 18th, 2019
Open Issues & Pull Requests: 32 (+0)
GitHub issues: Enabled
Number of forks: 961
Total Stargazers: 16,577 (+0)
Total Subscribers: 232 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 0.1 hours
Mean response time: 21.8 days
90th percentile: 143.6 days
Tracked items: 7

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 3
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,412 days
Stale 30+ days: 3
Stale 90+ days: 3

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

PySnooper is a debugging tool that traces function execution and variable changes without requiring a full debugger setup.

The problem it solves is the need to understand why code behaves unexpectedly when a traditional debugger is impractical or unwanted. Rather than scattering print statements throughout code, PySnooper lets you add a single decorator to a function and receive a detailed log showing which lines executed, in what order, and how local variables changed at each step. You can also wrap specific code blocks in a context manager to trace only the relevant section. The output goes to stderr by default but can be redirected to a file, stream, or custom callable. The tool supports watching arbitrary expressions beyond local variables and can trace into functions called by the decorated function.

PySnooper suits developers working in environments where setting up a traditional debugger is cumbersome, particularly in large or complex codebases where adding instrumentation quickly is valuable. It requires no configuration or setup beyond importing and decorating a function, making it practical for ad-hoc debugging in production-like environments or when exploring unfamiliar code. The tool is language-agnostic in philosophy but Python-specific in implementation, similar to how Bash's set -x works for shell scripts.

The project maintains steady engagement with its user base through documentation and issue responses. Development activity shows consistent attention to bug reports and feature requests from users. The maintainers have established clear guidance for advanced usage patterns through supplementary documentation. The project remains actively maintained with responsiveness to community contributions and feedback.