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.3.tar.gz (690.7 kB 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.3-py3-none-any.whl (697.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pybeats_by_veera-0.1.3.tar.gz
  • Upload date:
  • Size: 690.7 kB
  • 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.3.tar.gz
Algorithm Hash digest
SHA256 f82d52127cb4ce6e70a6c2f1c1cc24c1e6b029aed4871bdf8b22955e63bc3c75
MD5 9cf585d2b74d22415dc3ccd6046fe814
BLAKE2b-256 f3bc7a6e78bd2914b202fbbce039475aca1e09de2e946b4c60fb0d0b2c2f6ca8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pybeats_by_veera-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 460e3e6648ef303af1e24fb4588c8c5b7deaef050dcef9792fac309cfc884e75
MD5 651eb3f8cf2ef3c7fb9a69e0fc09147b
BLAKE2b-256 35855901aec125b84af7e9345e875d8a46aa004def94f7599b7a305bc22943c1

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