Skip to main content

Cross-platform notification sound library - lightweight and easy to use

Project description

beep-lite 🔊

Python License: MIT PyPI version

A simple, cross-platform notification sound library for Python.

Play the same WAV audio files on Windows / macOS / Linux with a lightweight, low-dependency, and reliable solution.

日本語

✨ Features

  • Cross-platform: Windows / macOS / Linux support
  • Lightweight: No heavy dependencies like numpy (~30KB)
  • Exception-safe: Never crashes your app on playback failure
  • Non-blocking: Asynchronous playback doesn't freeze your UI
  • PyInstaller ready: Bundle into standalone executables

📦 Installation

pip install beep-lite

Optional: High-quality audio backend

pip install beep-lite[audio]

🚀 Usage

import beep_lite as beep

# Basic notifications
beep.ok()       # ✅ Success
beep.ng()       # ❌ Error / Failure
beep.warn()     # ⚠️ Warning
beep.crit()     # 🚨 Critical / Urgent

# Fun notifications
beep.moo()      # 🐄 Low frequency
beep.mew()      # 🐱 High frequency

# Scan results
beep.scan_ok()  # 📗 Scan success
beep.scan_ng()  # 📕 Scan failure

Using Sound enum

from beep_lite import play, Sound

play(Sound.OK)
play(Sound.SCAN_NG)

Preload at startup (optional)

from beep_lite import preload_all

# Call at app startup to reduce latency on first play
preload_all()

🎵 Sound List

Function Sound Enum Use Case Characteristics
ok() Sound.OK Success Bright, short, ascending
ng() Sound.NG Error Descending, slightly longer
warn() Sound.WARN Warning Two-tone alert
crit() Sound.CRIT Critical Three low tones
moo() Sound.MOO Fun (low) Low frequency sweep
mew() Sound.MEW Fun (high) High frequency sweep
scan_ok() Sound.SCAN_OK Scan success Very short, sharp
scan_ng() Sound.SCAN_NG Scan failure Low, short

🔧 Backends

The library automatically selects the best available backend:

Priority Backend OS Dependency
1 winsound Windows None (stdlib)
2 simpleaudio All pip install simpleaudio
3 terminal bell All None (fallback)

📋 Requirements

  • Python 3.10+

Additional Requirements for Linux / Raspberry Pi

To use simpleaudio with the [audio] option, you need the ALSA development library:

# Debian / Ubuntu / Raspberry Pi OS
sudo apt-get install libasound2-dev

# Then install
pip install beep-lite[audio]

Note: If installed without [audio], the library falls back to terminal bell (\a), which requires no additional packages.

🎯 Use Cases

Barcode Scanner

def on_scan(barcode: str) -> None:
    if validate(barcode):
        beep.scan_ok()
        process(barcode)
    else:
        beep.scan_ng()

Long-running Task Completion

def heavy_task() -> None:
    try:
        # Heavy processing...
        result = process_data()
        beep.ok()
    except Exception:
        beep.ng()
        raise

GUI Form Validation

def on_submit() -> None:
    if not validate_form():
        beep.warn()
        show_error("Please check your input")
        return
    save_data()
    beep.ok()

🏭 PyInstaller Usage

pyinstaller --collect-data beep_lite your_app.py

Or in your .spec file:

datas=[('path/to/beep_lite/assets', 'beep_lite/assets')]

## 📄 License

MIT License

## 📬 Links

<!-- - [PyPI](https://pypi.org/project/beep-lite/) -->
- [GitHub](https://github.com/Moge800/beep_lite)

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

beep_lite-0.1.3.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

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

beep_lite-0.1.3-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beep_lite-0.1.3.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for beep_lite-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b5d90d7b40a1d4ef7552501c166e5da406421541433898c09b449c3f082bcb44
MD5 b41ccad3bb6caf42929a4ffef3e84faa
BLAKE2b-256 f530656afd8e8248883aa13fde72a4b3cf7dc43077a50cf1b7d1a9169d9bc37f

See more details on using hashes here.

Provenance

The following attestation bundles were made for beep_lite-0.1.3.tar.gz:

Publisher: publish.yml on Moge800/beep_lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: beep_lite-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for beep_lite-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2741156c969d5e47e7a37e105ff251cc68cb99f2b998f7b9acc7d23e418e7ca7
MD5 28bca05a1671a33e94c932ccbf41452e
BLAKE2b-256 63dfbf5cdcea7a62d1ded3c26830b738b042afbcda39d232ef5c2bd5080a9b4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for beep_lite-0.1.3-py3-none-any.whl:

Publisher: publish.yml on Moge800/beep_lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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