Skip to main content

Python's missing debug print command, and more.

Project description

python devtools

CI Coverage pypi versions license

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.7, 3.8, 3.9, 3.10 or 3.11. If you've got python 3.7+ 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:

python-devtools demo

Usage without Import

devtools can be used without from devtools import debug if you add debug into __builtins__ in sitecustomize.py.

For instructions on adding debug to __builtins__, see the installation docs.

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

Uploaded Source

Built Distribution

devtools-0.10.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: devtools-0.10.0.tar.gz
  • Upload date:
  • Size: 68.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for devtools-0.10.0.tar.gz
Algorithm Hash digest
SHA256 6eb7c4fa7c4b90e5cfe623537a9961d1dc3199d8be0981802c6931cd8f02418f
MD5 45edaaec84ccceb9c97ebcade191a4d6
BLAKE2b-256 e4d5a16445a372eea5730cc9051905d938c3530e2c5f91034701ca30fa6c4481

See more details on using hashes here.

File details

Details for the file devtools-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: devtools-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for devtools-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0bc02043bb032cdfb93e227226e2fea1aaea8f5a31fca25fabc4eadca22f228
MD5 4a7c07cac8dc499eab6e42e7f8ed17a0
BLAKE2b-256 50ac705b4de745ca0aa4d42f563b790465870b5fb24255d16c31d3d2e74b640c

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