devtools 0.12.2


pip install devtools

  Latest version

Released: Sep 03, 2023


Meta
Author: Samuel Colvin
Requires Python: >=3.7

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console
  • MacOS X

Intended Audience
  • Developers
  • Education
  • Information Technology
  • Science/Research
  • System Administrators

License
  • OSI Approved :: MIT License

Operating System
  • POSIX :: Linux
  • Unix

Programming Language
  • Python :: 3 :: Only
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11

Topic
  • Internet
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

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

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.

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
asttokens (<3.0.0,>=2.0.0)
executing (>=1.1.1)
pygments (>=2.15.0)