Skip to main content

Dev tools for python

Project description

BuildStatus Coverage pypi

Dev tools for python.

The debug print command python never had (and other things).

For more information, see documentation

Install

Just:

pip install devtools[pygments]

(pygments is not required but if it’s available output will be highlighted and easier to read.)

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:

https://raw.githubusercontent.com/samuelcolvin/python-devtools/master/demo.py.png

Usage without Import

modify /usr/lib/python3.6/sitecustomize.py making debug available in any python 3.6 code

# add devtools debug to builtins
try:
    from devtools import debug
except ImportError:
    pass
else:
    __builtins__['debug'] = debug

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devtools-0.5.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

devtools-0.5.1-py35.py36-none-any.whl (12.1 kB view details)

Uploaded Python 3.5 Python 3.6

File details

Details for the file devtools-0.5.1.tar.gz.

File metadata

  • Download URL: devtools-0.5.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

File hashes

Hashes for devtools-0.5.1.tar.gz
Algorithm Hash digest
SHA256 51ca8d2e15b8a862875a4837db2bafbc6cda409c069e960aec3f4bbd91fe9c08
MD5 3d743bc83eb5038377fa83122d4894f9
BLAKE2b-256 dc1a4dea78126300635d61b36df9fbbee59a9199aecbf5fcbfd478ff7f85bf8e

See more details on using hashes here.

File details

Details for the file devtools-0.5.1-py35.py36-none-any.whl.

File metadata

  • Download URL: devtools-0.5.1-py35.py36-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3.5, Python 3.6
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

File hashes

Hashes for devtools-0.5.1-py35.py36-none-any.whl
Algorithm Hash digest
SHA256 7a1f7db6ade0a71840ca4014d75dd72390aed2ef04e39e2b2445af7b3a3f4679
MD5 b4161e81a7a9efc7d10a2c4ba2ac8c23
BLAKE2b-256 ecc892e35e0c2913b2fd71497c5fd94501cd4339f55964c469b370d2b70db0a9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page