Skip to main content

CodeRoast

A Python library that insults programmers when their code throws errors. Because sometimes you need a reality check.

Overview

CodeRoast is a humorous Python library that catches exceptions and provides snarky commentary on your programming skills. Great for adding a bit of levity to the debugging process or for teaching humility to overconfident programmers.

Features

  • Automatically adds insults to exceptions
  • Provides a decorator for roasting specific functions
  • Includes insults categorized by error type
  • Can be enabled/disabled at runtime
  • Supports custom insults and personalization
  • Provides "roast levels" from mild to brutal

Installation

pip install coderoast

Usage

Basic Usage

Simply import the library and activate the roasting:

from coderoast import CodeRoast

# Activate the roasting globally
CodeRoast.activate()

# Now any unhandled exception will trigger an insult
def broken_function():
    return 1 / 0

try:
    broken_function()
except:
    pass  # The exception will be printed with an insult

Function Decorator

You can use the decorator to roast specific functions:

from coderoast import CodeRoast

# Only roast specific functions
@CodeRoast.roast_function
def another_broken_function():
    x = [1, 2, 3]
    return x[10]  # Index error

try:
    another_broken_function()
except:
    pass  # This function will be roasted

Setting Roast Level

Choose the severity of insults from mild to brutal:

from coderoast import CodeRoast, RoastLevel

# Set roast level
CodeRoast.set_roast_level(RoastLevel.MILD)  # More polite insults
# OR
CodeRoast.set_roast_level(RoastLevel.MEDIUM)  # Default level
# OR
CodeRoast.set_roast_level(RoastLevel.BRUTAL)  # No mercy

Getting Insults Directly

# Get a random insult
insult = CodeRoast.get_insult()
print(insult)

# Get an insult for a specific error type
insult = CodeRoast.get_insult_by_error(ValueError)
print(insult)

Customizing Insults

You can add your own insults to the library:

from coderoast import CodeRoast

# Add general insults
CodeRoast.add_insults([
    "This code is so bad it made my CPU cry.",
    "Have you considered a career in interpretive dance instead?",
])

# Add insults for specific error types
CodeRoast.add_categorized_insult('syntax', [
    "Your syntax is like abstract art - innovative but completely non-functional.",
    "I've seen more structure in a kindergarten finger painting than in your code.",
])

Enable/Disable

You can enable or disable the roasting at runtime:

# Disable roasting
CodeRoast.deactivate()

# Re-enable roasting
CodeRoast.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

🔥 ROASTED 🔥
👉 Your code has more bugs than a tropical rainforest.
👉 Maybe try again when you know what you're doing.

Insult Categories

CodeRoast includes specialized insults for different error types:

  • Syntax errors
  • Logic errors
  • Runtime errors
  • Mathematical errors
  • Type errors
  • And more!

Why Use CodeRoast?

  • To add humor to your debugging process
  • To humble yourself or your teammates
  • For educational purposes (teaching new programmers to handle exceptions)
  • Because normal error messages are too polite
  • To build character and resilience in coding

Pair with JediDebug

For a good cop/bad cop debugging experience, try pairing CodeRoast with its gentler counterpart, JediDebug!

Contributing

Feel free to contribute additional insults or features by submitting a pull request. The more creative the insults, the better!

License

MIT License

Metadata

Release files for coderoast 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coderoast 0.2.0
File Size Uploaded Provenance Actions
coderoast-0.2.0.tar.gz 14.0 kB Without provenance Details for coderoast-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for coderoast 0.2.0
File Interpreter ABI Platform Actions
coderoast-0.2.0-py3-none-any.whl Python 3 none any Details for coderoast-0.2.0-py3-none-any.whl

Total release size: 27.9 kB

Release files / coderoast-0.2.0.tar.gz

Download URL coderoast-0.2.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
410c93f7dbb1560a27221d80a19bb345b1086035b294750007b899781ed07434
BLAKE2b-256 checksum
How to use checksums
271dc9cd971bbd591db83281d5be3970c5c1d4762d9c99f02882a9de294464e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / coderoast-0.2.0-py3-none-any.whl

Download URL coderoast-0.2.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df87947a3dbac459a2d98297ac5f519eae0ce0cf04037117de3f916be03996fc
BLAKE2b-256 checksum
How to use checksums
69ebe48fb07bfbaa25135fabf66f9dcb4cdf19796b76297d71783180c7ffe1da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for coderoast 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page