Skip to main content

Automatic sound feedback for Python code execution in Jupyter, Google Colab, and IPython.

Project description

🎵 pybeats-by-veera

Automatic sound feedback for every Python cell execution in Jupyter, Google Colab, and IPython.

PyPI version Python License: MIT GitHub

What is pybeats-by-veera?

pybeats-by-veera hooks into IPython's event system so your notebook plays a sound automatically after every cell run — no wrapping, no decorators, no extra code.

  • Success sound when a cell runs without errors
  • Error sound when any exception occurs (including SyntaxError, ZeroDivisionError, etc.)

Installation

pip install pybeats-by-veera

Quick Start

import pybeats
pybeats.enable()

# Now every cell plays a sound automatically:
10 + 5      # ✅ success sound
1 / 0       # ❌ error sound (ZeroDivisionError)

API Reference

Function Description
pybeats.enable() Activate sound feedback
pybeats.enable(quiet=True) Sounds only, no console labels
pybeats.disable() Deactivate sound feedback
pybeats.is_enabled() Returns True if active
pybeats.status() Print current configuration
@pybeats.sound Decorator for individual functions

Decorator Usage

Works without enable() — wraps a single function:

@pybeats.sound
def fetch_data():
    # plays success or error sound when this function is called
    return requests.get("https://api.example.com/data").json()

Environment Support

Environment Status Audio Method
Google Colab ✅ Full support IPython.display.Audio (browser autoplay)
Jupyter Notebook ✅ Full support IPython.display.Audio (browser autoplay)
JupyterLab ✅ Full support IPython.display.Audio (browser autoplay)
IPython terminal ⚠️ Partial System audio (afplay / aplay / winsound)
Plain Python ❌ Not supported Graceful warning, no crash

Quiet Mode

Play sounds without the console labels:

pybeats.enable(quiet=True)

How It Works

pybeats-by-veera uses two IPython hooks:

  1. post_run_cell event — fires after every cell execution, provides success/error status
  2. set_custom_exc — intercepts exceptions (including SyntaxError) before IPython's default handler

Both hooks are registered once on enable() and removed cleanly on disable().

License

MIT — Veerakumar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybeats_by_veera-0.1.2.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybeats_by_veera-0.1.2-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

Details for the file pybeats_by_veera-0.1.2.tar.gz.

File metadata

  • Download URL: pybeats_by_veera-0.1.2.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for pybeats_by_veera-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7f4723e2336a6d2b73b049f3763111932d57690c2089af8cf24460c203d94124
MD5 84cda0c036eb2f7da6dcc76ab421df4e
BLAKE2b-256 acc6a91bc73bdfb1ebe00f8de7520e8c33e09046acd1938457f8611290314d84

See more details on using hashes here.

File details

Details for the file pybeats_by_veera-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pybeats_by_veera-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 54072e2a62e09cc6218712ca523d530623f8b3e07c21bdfcdbd6ed3bd12361c4
MD5 60f33ba6b537310d4d755ead28900e63
BLAKE2b-256 a2a44451ae6d548b22a6bd19e1a075b9857c534f88fa49a83df5329637754406

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page