Metadata-Version: 2.4
Name: pybeats-by-veera
Version: 0.1.2
Summary: Automatic sound feedback for Python code execution in Jupyter, Google Colab, and IPython.
Author: Veerakumar C B
License: MIT
Project-URL: Homepage, https://github.com/vkprince6/pybeats
Project-URL: Repository, https://github.com/vkprince6/pybeats
Project-URL: Bug Tracker, https://github.com/vkprince6/pybeats/issues
Keywords: jupyter,colab,ipython,audio,sound,feedback,developer-tools
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Multimedia :: Sound/Audio :: Players
Classifier: Framework :: Jupyter
Classifier: Framework :: IPython
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: IPython>=7.0
Provides-Extra: terminal
Requires-Dist: playsound>=1.3.0; extra == "terminal"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# 🎵 pybeats-by-veera

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

[![PyPI version](https://img.shields.io/pypi/v/pybeats-by-veera.svg)](https://pypi.org/project/pybeats-by-veera/)
[![Python](https://img.shields.io/pypi/pyversions/pybeats-by-veera.svg)](https://pypi.org/project/pybeats-by-veera/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![GitHub](https://img.shields.io/badge/GitHub-vkprince6%2Fpybeats-blue.svg)](https://github.com/vkprince6/pybeats)

## 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

```bash
pip install pybeats-by-veera
```

## Quick Start

```python
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:

```python
@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:

```python
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](https://github.com/vkprince6/pybeats)
