Skip to main content

Dev tools for python

Project description

BuildStatus Coverage pypi

Dev tools for python. WIP

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 demo.py:

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:

./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.1.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

devtools-0.1-py35,py36-none-any.whl (10.9 kB view hashes)

Uploaded Python 3.5,py36

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