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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devtools-0.4-py35,py36-none-any.whl (11.7 kB view details)

Uploaded Python 3.5,py36

File details

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

File metadata

  • Download URL: devtools-0.4.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for devtools-0.4.tar.gz
Algorithm Hash digest
SHA256 4626be266be168aa7d81cb49a59a1098efeaa6d0df570f52aebd1ee9b471363c
MD5 81234ad24f98a3cc3671ec461dff5b0c
BLAKE2b-256 5570401cb5c36eccf3948a388970934a241f153beb71eeaa41f943a9f3177220

See more details on using hashes here.

File details

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

File metadata

  • Download URL: devtools-0.4-py35,py36-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3.5,py36
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for devtools-0.4-py35,py36-none-any.whl
Algorithm Hash digest
SHA256 6736dab366227809945bfac66179ff0531827d46b22728889c2c0d1d326a560b
MD5 f12e0e7263adff843b034f8921013e4b
BLAKE2b-256 9e51954701c1d4e208a61008d00c8191b72df4a69edf042bb6eb8e771f0b9cc2

See more details on using hashes here.

Supported by

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