CMD + K

pysnooper

Community

A poor man's debugger for Python.

Installation

To install this package, run one of the following:

Conda
$conda install conda-forge::pysnooper

Usage Tracking

1.2.1
1.2.0
1.1.1
1.1.0
0.5.0
5 / 8 versions selected
Downloads (Last 6 months): 0

Description

PySnooper is a poor man's debugger.

You're trying to figure out why your Python code isn't doing what you think it should be doing. You'd love to use a full-fledged debugger with breakpoints and watches, but you can't be bothered to set one up right now.

You want to know which lines are running and which aren't, and what the values of the local variables are. Most people would use print lines, in strategic locations, some of them showing the values of variables.

PySnooper lets you do the same, except instead of carefully crafting the right print lines, you just add one decorator line to the function you're interested in. You'll get a play-by-play log of your function, including which lines ran and when, and exactly when local variables were changed.

What makes PySnooper stand out from all other code intelligence tools? You can use it in your shitty, sprawling enterprise codebase without having to do any setup. Just slap the decorator on, as shown below, and redirect the output to a dedicated log file by specifying its path as the first argument.

About

Summary

A poor man's debugger for Python.

Last Updated

Sep 9, 2024 at 11:07

License

MIT

Total Downloads

141.8K

Supported Platforms

noarch