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 or 3.10. 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.9.0.tar.gz (68.2 kB view details)

Uploaded Source

Built Distribution

devtools-0.9.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for devtools-0.9.0.tar.gz
Algorithm Hash digest
SHA256 86ede6e0273e023db766344d14098228785b48a80f31716f28e8b9453d52fa1e
MD5 5ab74a7a38f0f9fb6e11ef45c67f1df3
BLAKE2b-256 2de2a1e80801b195539f552a2a369691e09ecc27648f5c5c0c0cab0256f4f098

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for devtools-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 689cf4e7c75024237c42093ba19f4fa9cf15980269f02463aeab4d97d4b0a215
MD5 6c40385ff8e00b72130ce8d45448381f
BLAKE2b-256 8e3a741773833ee8f1d18d5ce377c3b062f0d63b951fb9e4bec25f994c7f4631

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