Skip to content

Repository files navigation

debug dojo

🏣 debug dojo, a place for zen debugging

PyPi Version PyPI pyversions downloads license pre-commit.ci status

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.

✨ Features

  • 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 rich for 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 inspect utility.
  • Simplified Breakpoints: Set breakpoints effortlessly with a concise helper function.

🚀 Installation

Install debug-dojo using pip:

pip install debug-dojo

For full debugger support, you might want to install optional dependencies:

pip install "debug-dojo[all-debuggers]"

💻 CLI Usage

Run your Python script or module with dojo run:

dojo run my_script.py

Check your progress and current belt with:

dojo belt

Specify a debugger, configuration file, or enable verbose output:

dojo run --debugger ipdb --config dojo.toml --verbose --module my_module

Run an executable command with debugging tools:

dojo run --exec pytest

🐍 Usage in Code

Integrate 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()

📚 Documentation

For comprehensive instructions on installation, configuration, advanced usage, and API reference, please visit the official documentation.

🤝 Contributing

Contributions are welcome! Please refer to the development guidelines for details on how to set up your development environment and submit changes.

About

Debugging utilities dojo

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages