A lightweight developer utility that plays professional/chaotic sound effects on Python exceptions.
Project description
🚨 suserror
suserror is a lightweight, fun developer utility that turns your Python exceptions into an auditory experience. Whether you want a subtle alert or total chaos, suserror ensures you hear your mistakes.
✨ Features
- 🎧 Instant Feedback: Plays a random sound whenever an exception goes uncaught.
- ⚡ Non-blocking: Sound playback happens in a daemon thread; your program won't freeze.
- 🎭 Sound Modes: Choose between
subtlefor a quick heads-up orchaoticfor maximum impact. - 🛠️ Customizable: Drop your own
.mp3files into thesounds/folder to personalize your errors. - 🐍 Universal: Works seamlessly with any Python 3.8+ project.
🚀 Installation
For the best experience, install suserror in a virtual environment:
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install suserror
pip install .
Note: Depends on pygame for high-quality audio handling.
📖 Usage
🧙♂️ Automatic Mode (The "Set and Forget")
Just one line at the top of your script, and you're good to go. All uncaught exceptions will trigger a random sound.
import suserror
# Start the auto-hook (default mode is 'all')
suserror.auto()
# Any error below will trigger a sound
1 / 0
🎭 Switching Modes
You can control the vibe of your errors by passing a mode to auto().
# For a more professional/minimalist feel
suserror.auto(mode="subtle")
# For when you really messed up
suserror.auto(mode="chaotic")
🕹️ Manual Mode
Trigger a sound effect programmatically whenever you want.
import suserror
try:
process_sensitive_data()
except DataError:
suserror.play_error(mode="chaotic")
# Log the error or handle it
📂 Sound Categories
The package comes with several pre-bundled sounds categorized as follows:
- Subtle: Minimalist pings and short alerts (e.g.,
anime-ahh.mp3). - Chaotic: Longer, louder, or more "sus" sounds (e.g.,
among-us-role-reveal-sound.mp3,fahhhhhhhhhhhhhh.mp3).
🛠️ Development & Customization
To add your own sound effects:
- Navigate to the
suserror/sounds/directory. - Drop your
.mp3files there. - (Optional) Update
SOUND_MODESinplayer.pyto categorize them.
📜 License
Distributed under the MIT License. See LICENSE for more information.
Made with ❤️ for the Python community
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 suserror-0.2.1.tar.gz.
File metadata
- Download URL: suserror-0.2.1.tar.gz
- Upload date:
- Size: 607.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5ccb718e87be83b04c3d703feebffdf3bebc772692c94046bdc44ebd68799d0
|
|
| MD5 |
2c7d8752d05931c92db60080ca473f56
|
|
| BLAKE2b-256 |
eccd681ddf2e49820f9c477a4c895d51c89615f1840eb52420b81242c588f92d
|
File details
Details for the file suserror-0.2.1-py3-none-any.whl.
File metadata
- Download URL: suserror-0.2.1-py3-none-any.whl
- Upload date:
- Size: 605.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4c2da6046f8c2fb339b476230684880f6954546510ed21efb0524c8689e6600
|
|
| MD5 |
e37a471934b8ebf15c86d4e767a0a2ac
|
|
| BLAKE2b-256 |
4cb0bf8260de32ce0f5ac4c51d854e602d3837926899b92600795e8c25778820
|