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.3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

devtools-0.3-py35,py36-none-any.whl (12.6 kB view details)

Uploaded Python 3.5,py36

File details

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

File metadata

  • Download URL: devtools-0.3.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for devtools-0.3.tar.gz
Algorithm Hash digest
SHA256 13cd487fb557ebf856da33ac5f6f81bc188c4b6374240b45a1d5f1115cb8abc2
MD5 06fac37dbcdffc30d3bb479da71befa1
BLAKE2b-256 f47d9c7dc1ff30f19b8b2b1558be91e6b4a5258d6ea2b0cce5d1f7d0f15e38d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for devtools-0.3-py35,py36-none-any.whl
Algorithm Hash digest
SHA256 528720acfdba01698b6239d0d79d55776929c103db5b7a81793d726ecb1383fe
MD5 e22faf142ff7f8b41c5c5cb2d31432da
BLAKE2b-256 44b6a74e231d0a88eeee702d5e4ee07452d5afaa31513ea4ba12c51d2b58039a

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