devtools
Python's missing debug print command, and more.
What it is and what it does
devtools is a debugging utility that replaces bare print statements with a smarter `debug()` function. When you call `debug(variable)`, it outputs the variable name, its value, and its type in a formatted, readable way—including the file and line number where the call was made. It handles complex nested structures (dicts, lists, numpy arrays, generators) with intelligent formatting and syntax highlighting via pygments.
The package works by introspecting the call stack via asttokens and executing to extract the variable name from your source code, so you get both the name and the value without repeating yourself. It can also be injected into Python's `__builtins__` to make `debug()` available globally without an import.
Use it for:
- Inspect variable state during development without writing repetitive print statements.
- Debug complex nested data structures with automatic pretty-printing and syntax highlighting.
- Add file and line number context to debug output for faster location of statements in source code.
- Temporarily replace print statements in scripts and notebooks while maintaining readable output.
- Explore generator and iterator contents inline during interactive development.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a `debug()` function that prints variables with their names, types, and values in a readable format, replacing ad-hoc print statements during development.
Yes, if you spend time debugging Python code interactively or in development. It's a low-friction, zero-security-risk utility that genuinely saves keystrokes and improves readability of debug output. The dormant maintenance is not a blocker—the package is stable and has no known vulnerabilities—but compatibility with Python versions beyond 3.11 is unverified.
Install
devtools on PyPI
pip
pip install devtoolsuv
uv add devtoolspoetry
poetry add devtoolsInstalling devtools
Before you install
Low friction: pure Python wheel with three lightweight dependencies (asttokens, executing, pygments). Dormant maintenance status—last release was 2023-09-03 and no commits since 2025-01-24—but the package is marked Production/Stable and has seen no security issues.
License in practice
MIT license (permissive): you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.
Quickstart
pip install devtools
from devtools import debug
whatever = [1, 2, 3]
debug(whatever)
Verify before relying
- Whether the package remains compatible with Python 3.12+ given dormant maintenance status.
- Performance impact of debug() calls on large data structures or in tight loops.
- Whether debug() can be injected into __builtins__ via sitecustomize.py as documented.
Package facts
| License | The MIT License (MIT) Copyright (c) 2017 to present Samuel Colvin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — asttokens, executing, pygments |
| Maintenance | dormant — 1,076 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,853,323/month — #2,859 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: devtools-0.12.2-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
stackprinterReplaces Python's default exception traceback…
permissive · top 15,000 on PyPI
shutilsProvides utility tools for Python development,…
permissive · top 15,000 on PyPI
tracebackturbo3A drop-in replacement for Python's traceback…
permissive · top 15,000 on PyPI
PySnooperPySnooper is a decorator-based debugging tool…
permissive · top 15,000 on PyPI
prettyprinterSyntax-highlighted, declarative pretty printer…
permissive · top 5,000 on PyPI
traceriteFormats Python exceptions and tracebacks into…
permissive · top 5,000 on PyPI
tabulateFormats and prints tabular data in plain text…
permissive · top 1,000 on PyPI
icecreamIceCream provides a drop-in replacement for…
permissive · top 5,000 on PyPI
mandomando wraps argparse to let you build…
permissive · top 5,000 on PyPI
inflectGenerates correct English plurals, singulars,…
permissive · top 1,000 on PyPI