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.1.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.1-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pybeats_by_veera-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c252e0cdfcfafdbaa6e75460373e34edbb43fdfe7b5de211d3ad4e4e42557610
MD5 f508796c4de4948b1c699f80790da521
BLAKE2b-256 c4e956ff54cbe285e0ed5df11cab1ea339c3d89a39250d71d7a37f037ed8b3f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pybeats_by_veera-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c7e3c585209d06680dd32521375162a130c2b30c47e2452354213c42d187e7f
MD5 d597f70df9333011f8981aff373b418a
BLAKE2b-256 97f0b2b8fa5662342be0ca20053b13ec2e18b94c0d7fb746e44bdd3d7283d876

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