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.2.tar.gz (26.4 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.2-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beep_lite-0.1.2.tar.gz
  • Upload date:
  • Size: 26.4 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.2.tar.gz
Algorithm Hash digest
SHA256 c6c82a4cfd6a38795319dab8310c811cf77dd820d06544c4aefd839fe2847b02
MD5 681e74df72c6cbbb8c97b08fbf535f72
BLAKE2b-256 2538be733650b853772060b120c14015390115964a4b16efaa45190f3e59ff12

See more details on using hashes here.

Provenance

The following attestation bundles were made for beep_lite-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: beep_lite-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 30.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6c91c5c51d6b3d8bcab416164cfdfdc0b8b7209d44f0146ecbfde1b9630da6a5
MD5 f709c5188416fc791fc7633c6b2fae28
BLAKE2b-256 2da9bafd5b7bfddf65e494a160908393819cbfaeebd736875ffd7c18ef2ffc94

See more details on using hashes here.

Provenance

The following attestation bundles were made for beep_lite-0.1.2-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