skillfed

devtools

Python's missing debug print command, and more.

devtools v0.12.2 2.9M downloads/30d#2,859 on PyPI1,078
Permissive 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) DORMANT released

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 devtools

uv

uv add devtools

poetry

poetry add devtools

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: MacOS XIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

debug print functionpretty print debuggingvariable inspection tooldevelopment print helperpython debug outputformatted debug printingcode inspection utility
debuggingrepl-friendlydev-tools

More Python Modules packages