🏣 debug dojo, a place for zen debugging
debug-dojo is a powerful Python package designed to streamline your debugging workflow directly from the terminal. It integrates seamlessly with popular debuggers and enhances your inspection capabilities with beautiful, readable output.
- Unified Debugging Interface: Easily launch your scripts or modules with your preferred debugger (
debugpy,pudb,pdb,ipdb). - Dojo Belts Gamification: Earn belts based on your debugging experience and track your progress.
- Enhanced Output with Rich: Leverages
richfor stunning, syntax-highlighted code, pretty-printed objects, and improved tracebacks. - Side-by-side Object Comparison: Quickly identify differences between two Python objects.
- Interactive Object Inspection: Dive deep into object structures with a powerful
inspectutility. - Simplified Breakpoints: Set breakpoints effortlessly with a concise helper function.
Install debug-dojo using pip:
pip install debug-dojoFor full debugger support, you might want to install optional dependencies:
pip install "debug-dojo[all-debuggers]"Run your Python script or module with dojo run:
dojo run my_script.pyCheck your progress and current belt with:
dojo beltSpecify a debugger, configuration file, or enable verbose output:
dojo run --debugger ipdb --config dojo.toml --verbose --module my_moduleRun an executable command with debugging tools:
dojo run --exec pytestIntegrate debug-dojo directly into your Python code for on-demand debugging and inspection utilities:
import debug_dojo.install
# Set a breakpoint and enter the debugger
# debug_dojo.install.b() # Equivalent to breakpoint()
object_1 = {"foo": 1, "bar": 2}
object_2 = [1, 2, 3]
# Pretty print an object with Rich
debug_dojo.install.p(object_1)
# Inspect an object using Rich
debug_dojo.install.i(object_1)
# Compare two objects side-by-side
debug_dojo.install.c(object_1, object_2)
# Enter the debugger (e.g., ipdb, pudb, pdb, debugpy based on config)
# debug_dojo.install.b()For comprehensive instructions on installation, configuration, advanced usage, and API reference, please visit the official documentation.
Contributions are welcome! Please refer to the development guidelines for details on how to set up your development environment and submit changes.
