A library that motivates programmers with Star Wars quotes when their code has bugs
Project description
JediDebug
A Python library that motivates programmers with Star Wars quotes when bugs occur. May the Force be with your debugging!
Overview
JediDebug is a lighthearted Python library that catches exceptions and provides motivational Star Wars-themed wisdom. Perfect for keeping spirits high during frustrating debugging sessions and adding a touch of the Force to your development workflow.
Features
- Automatically adds Star Wars quotes to exceptions
- Provides a decorator for adding Jedi wisdom to function errors
- Includes quotes from various Star Wars characters and films
- Can be enabled/disabled at runtime
- Supports custom Jedi quotes and categories
Installation
pip install jedidebug
Usage
Basic Usage
Simply import the library and activate the Jedi wisdom:
from jedidebug import JediDebug
# Activate the Jedi wisdom globally
JediDebug.activate()
# Now any unhandled exception will trigger a motivational Star Wars quote
def broken_function():
return 1 / 0
try:
broken_function()
except:
pass # The exception will be printed with Jedi wisdom
Function Decorator
You can use the decorator to add Jedi wisdom to specific functions:
from jedidebug import JediDebug
# Only provide Jedi guidance for specific functions
@JediDebug.jedi_function
def another_broken_function():
x = [1, 2, 3]
return x[10] # Index error
try:
another_broken_function()
except:
pass # This function will receive Jedi wisdom
Getting Quotes Directly
# Get a random quote
wisdom = JediDebug.get_motivational_quote()
print(wisdom)
# Get wisdom from a specific category (if available)
wisdom = JediDebug.get_quote_by_category('debugging')
print(wisdom)
Customizing Quotes
You can add your own Star Wars quotes to the library:
from jedidebug import JediDebug
# Add custom quotes
JediDebug.add_quotes([
"The bug is strong with this one.",
"You were the chosen one! You were supposed to destroy the bugs, not create them!",
])
# Add categorized quotes
JediDebug.add_categorized_quotes('syntax', [
"The syntax is strong with this one, but your brackets are not.",
"Your indentation has strayed to the dark side.",
])
Enable/Disable
You can enable or disable the Jedi wisdom at runtime:
# Disable Jedi wisdom
JediDebug.deactivate()
# Re-enable Jedi wisdom
JediDebug.activate()
Sample Output
Traceback (most recent call last):
File "example.py", line 10, in <module>
broken_function()
File "example.py", line 7, in broken_function
return 1 / 0
ZeroDivisionError: division by zero
✨ JEDI WISDOM ✨
🌟 I find your lack of comments disturbing.
🌟 Trust your instincts, young Padawan. The solution is near.
Quote Categories
JediDebug includes quotes for different error scenarios:
- General debugging wisdom
- Logic errors
- Syntax issues
- Runtime problems
- And more!
Why Use JediDebug?
- To add some fun to your debugging process
- To maintain motivation during frustrating bug hunts
- To bring the wisdom of Star Wars to your development workflow
- Because even Jedi Masters encounter bugs in their code
Contributing
Feel free to contribute additional Star Wars quotes or features by submitting a pull request.
License
MIT License
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 jedidebug-0.2.0.tar.gz.
File metadata
- Download URL: jedidebug-0.2.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52c750b289f9757673fa61f0e6e06d62bc24d6d3f4a46da67c3a4278a3a95269
|
|
| MD5 |
c5faa9b74c85cda2e4cbf01e4c4bc9cb
|
|
| BLAKE2b-256 |
92d2df24c77707fdf83a6a95b4c669c596a3d855ecc57edddda4e95f05c7d999
|
File details
Details for the file jedidebug-0.2.0-py3-none-any.whl.
File metadata
- Download URL: jedidebug-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17dc783eda1ef08abd2d21ce86eef86f1da2c3725e02949476b3a16bb69ca486
|
|
| MD5 |
a275d0244f00cc7db5c1965a07e7bbb0
|
|
| BLAKE2b-256 |
6246cddcbc88fb44aa464a857fcaa1e53e9fddf831f667e0dcea017a8677b500
|