Skip to main content

Progress bars with sound enhancements

Project description

tqdm_sound adds sounds to the well-known progress bar library TQDM.

It extends the TQDM base class, so anything you can do in TQDM you can do in this library.

It can self-mute during mouse or keyboard activity.

Motivation

I was renovating while running very long ML tasks, and I wanted a way of tracking how everything was going while I had paint on my hands.

This was inspired by the work of Ryoji Ikeda and includes sounds similar to data.matrix. You can create any set of WAV files for your project, but I picked this because it’s subtle and unobtrusive.

Use Cases

  1. Screen-free progress tracking

  2. Accessibility for developers using screen readers

  3. You hate your co-workers

Installation

pip install tqdm_sound

Examples

Basic Example

from tqdm_sound import TqdmSound
import random
import time

# Example usage:
if __name__ == "__main__":
    sound_monitor = TqdmSound(theme="ryoji_ikeda", activity_mute_seconds=1)

    my_list = [0] * 50
    progress_one = sound_monitor.progress_bar(my_list, desc="Processing", volume=100, background_volume=30, end_wait=1, ten_percent_ticks=True)
    for _ in progress_one:
        time.sleep(random.uniform(.2, .5))

Silence When Active

If you’re actively using your mouse/keyboard, you can silence the program via the activity_mute_seconds parameter. To mute for 5 seconds after mouse/keyboard activity:

sound_monitor = TqdmSound(theme="ryoji_ikeda", activity_mute_seconds=5)

my_list = [0] * 10
progress_one = sound_monitor.progress_bar(my_list, desc="Processing", volume=100, background_volume=30, end_wait=1, ten_percent_ticks=False)
for _ in progress_one:
    time.sleep(random.uniform(.2, .5))

Play Final Sound

This is just a shortcut to play program_end_tone.wav:

sound_monitor.play_final_end_tone(50)

Play Any Sound in the Theme Directory

Play any WAV file in the sounds/your_theme directory:

sound_monitor.play_sound_file('short_beep.wav', 50)

Sound Files

Add your own collection of sound files by adding a directory to the sounds folder, which will correspond to the “theme” argument.

Interval Sounds

click_###.wav are played at every interval that is not the start, middle, or end. You can have any number of these files in this format to increase/decrease variation.

Major Sounds

  1. start_tone.wav plays at the start of each loop.

  2. mid_tone.wav plays at the midpoint of each loop.

  3. end_tone.wav plays at the end of each loop.

  4. semi_major.wav plays at every 10% step when ten_percent_ticks=True.

  5. program_end_tone.wav is an optional sound that plays at the end of a given loop—this is just a convenience function you might use as the last loop in your program.

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

tqdm_sound-1.1.0.tar.gz (323.8 kB view details)

Uploaded Source

Built Distribution

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

tqdm_sound-1.1.0-py3-none-any.whl (324.8 kB view details)

Uploaded Python 3

File details

Details for the file tqdm_sound-1.1.0.tar.gz.

File metadata

  • Download URL: tqdm_sound-1.1.0.tar.gz
  • Upload date:
  • Size: 323.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tqdm_sound-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9f6578061d6e36ac1d0b7f3da79e067c65e119404be58d1882627c440dae298c
MD5 2316e2ea43e6e3de7c5083ef06ee9c39
BLAKE2b-256 517763df7bcbc9230b065308f67a8cf9a63703d551376d2db6e5bade0f9f0f80

See more details on using hashes here.

Provenance

The following attestation bundles were made for tqdm_sound-1.1.0.tar.gz:

Publisher: python-publish.yml on looking-glass-station/tqdm-sound

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

File details

Details for the file tqdm_sound-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: tqdm_sound-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 324.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tqdm_sound-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a383f52b16bc29070cbc523fa8bf1c47fdb8bb03d600c072722f11aa2de61a23
MD5 512ad7499e265c7ae96cb6f121c3d773
BLAKE2b-256 58fd0b0e98f9301ea9e1f446e889256988cc123770ee1dde35ee24fd434e7e63

See more details on using hashes here.

Provenance

The following attestation bundles were made for tqdm_sound-1.1.0-py3-none-any.whl:

Publisher: python-publish.yml on looking-glass-station/tqdm-sound

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