Python's missing debug print command and other development tools.
Project description
python devtools
Python's missing debug print command and other development tools.
For more information, see documentation.
Install
Just
pip install devtools[pygments]
pygments
is not required but if it's installed, output will be highlighted and easier to read.
devtools
has no other required dependencies except python 3.6, 3.7, or 3.8.
If you've got python 3.6+ and pip
installed, you're good to go.
Usage
from devtools import debug
whatever = [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:
import numpy as np
data = {
'foo': np.array(range(20)),
'bar': {'apple', 'banana', 'carrot', 'grapefruit'},
'spam': [{'a': i, 'b': (i for i in range(3))} for i in range(3)],
'sentence': 'this is just a boring sentence.\n' * 4
}
debug(data)
outputs:
Usage without Import
modify /usr/lib/python3.8/sitecustomize.py
making debug
available in any python 3.8 code
# add devtools debug to builtins
try:
from devtools import debug
except ImportError:
pass
else:
__builtins__['debug'] = debug
v0.6.0 (2020-07-29)
- improve
__pretty__
to work better with pydantic classes, #52 - improve the way statement ranges are calculated, #58
- drastically improve import time, #50
- pretty printing for non-standard dicts, #60
- better statement finding for multi-line statements, #61
- colors in windows, #57
- fix
debug(type(dict(...)))
, #62
v0.5.1 (2019-10-09)
- fix python tag in
setup.cfg
, #46
v0.5.0 (2019-01-03)
v0.4.0 (2018-12-29)
- remove use of
warnings
, include in output, #30 - fix rendering errors #31
- better str and bytes wrapping #32
- add
len
everywhere possible, part of #16
v0.3.0 (2017-10-11)
- allow
async/await
arguments - fix subscript
- fix weird named tuples eg.
mock > call_args
- add
timer
v0.2.0 (2017-09-14)
- improve output
- numerous bug fixes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file devtools-0.6.1.tar.gz
.
File metadata
- Download URL: devtools-0.6.1.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a054307594d35d28fae8df7629967363e851ae0ac7b2152640a8a401c39d42d7 |
|
MD5 | f5cf5b4f0102cb00ddadab213a2d4817 |
|
BLAKE2b-256 | 0502a72f52c5604c3fc3eab1e2ef6d9917ec601d41e86079e093b78a21b2f953 |
File details
Details for the file devtools-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: devtools-0.6.1-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7334183972a8d04e81d08b7f62126abca9b6f4de51d825c5fdcb9c88f252601a |
|
MD5 | ead7a869f4273ebec56203167feab0d0 |
|
BLAKE2b-256 | eb5dfe034959b814b78d389fd4135011bee6b1fe1f05b4540001f34b7a6e6cf9 |