Skip to content

Repository files navigation

python devtools

CICoveragepypiversionslicense

Python's missing debug print command and other development tools.

For more information, see documentation.

Install

Just

pip install devtools

If you've got python 3.7+ and pip installed, you're good to go.

Usage

fromdevtoolsimportdebugwhatever= [1, 2, 3]
debug(whatever)

Outputs:

test.py:4<module>:
whatever: [1, 2, 3] (list)

That's only the tip of the iceberg, for example:

importnumpyasnpdata= {
'foo': np.array(range(20)),
'bar': {'apple', 'banana', 'carrot', 'grapefruit'},
'spam': [{'a': i, 'b': (iforiinrange(3))} foriinrange(3)],
'sentence': 'this is just a boring sentence.\n'*4
}
debug(data)

outputs:

python-devtools demo

Usage without Import

devtools can be used without from devtools import debug if you add debug into __builtins__ in sitecustomize.py.

For instructions on adding debug to __builtins__, see the installation docs.

About

Dev tools for python

Topics

Resources

Stars

1.1k stars

Watchers

8 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages