Debbugging dojo for Python developers
Project description
debug dojo, a place for zen debugging
debug-dojo is a Python package providing utilities for enhanced debugging and inspection in the terminal. It leverages rich for beautiful output and offers helpers for side-by-side object comparison, improved tracebacks from rich, and easy integration with PuDB. All tools can be installed at once or individually, allowing for flexible debugging setups.
Features
- Convenient CLI Quickly run your code with debugging tools enabled.
- Simple API: Install all tools or only what you need.
- PuDB integration: Quickly enable the PuDB TUI debugger.
- Rich tracebacks: Get readable, colorized tracebacks for easier debugging.
- Side-by-side object inspection: Visually compare Python objects, their attributes, and methods in the terminal.
Usage
CLI
Run your Python script with debugging tools enabled using the debug-dojo command:
dojo my_script.py
Install all debugging tools
In the PuDB style, you can install all debugging tools and enter the debugging mode with a single command:
import debug_dojo.all; b()
p(object_1) # Pretty print an object with Rich
i(object_1) # Inspect an object
c(object_1, object_2) # Compare two objects side-by-side
Where:
b()is a builtin-injected function that sets a breakpoint using PuDB'sset_trace().p(object_1)is pretty printing of an object using Rich.i(object_1)to inspect an object using Rich.c(object_1, object_2)to compare two objects side-by-side.
Use individual tools
from debug_dojo import install_inspect, use_pudb, use_rich_traceback
install_inspect() # Enable object inspection helpers
use_pudb() # Set up PuDB as the debugger
use_rich_traceback() # Enable Rich tracebacks
Compare objects side-by-side
from debug_dojo.compareres import inspect_objects_side_by_side
a = {"foo": 1, "bar": 2}
b = [1, 2, 3]
inspect_objects_side_by_side(a, b)
Installation
The package is available on PyPI and can be installed using standard Python package management tools.
pip install debug-dojo
You can also use poetry or uv to add it to your project:
poetry add debug-dojo
uv add debug-dojo
Note that dojo most likely will not work when installed via pipx or uvx, as it relies on the current Python environment dependencies.
Development
Lint and type check
ruff check src/debug_dojo --fix
basedpyright src/debug_dojo
Changelog
v0.2.0 (2025-07-20)
release tag: [v0.2.0]
What's Changed
- Added
dojocommand for easy debugging setup. - Added
p()function for rich printing. - Added history file for tracking changes.
- Moved to
hatchfor building and packaging.
Fixes
- Fixed
pyproject.tomlto point to GitHub repository as the homepage.
v0.1.0 (2025-07-19)
release tag: [v0.1.0]
What's Changed
- Initial module to install debugging tools.
- Debug mode utilities for PuDB, rich tracebacks, and object inspection.
Fixes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file debug_dojo-0.3.0.tar.gz.
File metadata
- Download URL: debug_dojo-0.3.0.tar.gz
- Upload date:
- Size: 92.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66ad8dfcdeab492da849193dd5fed00d113ef9bce92c5c68b3f298638e54e0e3
|
|
| MD5 |
774c3aec7db145f0b97f553ae5efbe9e
|
|
| BLAKE2b-256 |
ad93a689bb41aa00d385d0a097eb6c30d4ff08c3675f3abcfa46d76904842fd5
|
File details
Details for the file debug_dojo-0.3.0-py3-none-any.whl.
File metadata
- Download URL: debug_dojo-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4810e6d42563f67cc05494a55dcaa8b11e1903f2712063ee394810433e50cb1
|
|
| MD5 |
39a935d0150056044ac5d7bb63d94674
|
|
| BLAKE2b-256 |
cc53b5b40650feade608597bcf1406fb758200bd68be558b305f3d7ef29af9b4
|