Skip to main content

A package to play an alarm after an interval

Project description

PyBites Alarm

Play a music file or voice message after an interval of N minutes or seconds.

Install the tool

$ pip install pybites-alarm
$ alarm
usage: alarm [-h] (-s SECONDS | -m MINUTES) [-b | -d] [-l SONG_LIBRARY | -f FILE | -M MESSAGE] [-v] [-t TIMEOUT]
alarm: error: one of the arguments -s/--seconds -m/--minutes is required

Usage

You can specify an interval time using seconds (-s) or minutes (-m).

By default it runs in the foreground, but you can run it in the background using b.

To display the seconds countdown use -d.

There are three ways to play an alarm file:

  1. Specify one with -f.

  2. Pick a random file from your music library directory. For that use -l.

  3. Use a default file by setting ALARM_MUSIC_FILE in .env, for example:

    $ cat .env
    ALARM_MUSIC_FILE=/Users/bbelderbos/Music/alarm.mp4
    

It can be confusing when a music file plays so since 0.0.4 you can play a voice message instead using -M (--message).

For example:

alarm -M "stand up for a walk" -m 20 -b

A voice repeats "stand up for a walk" three times after 20 minutes. Pretty useful for programmers :)

For long alarm files you can set a timeout to stop the alarm after N seconds using the t (--timeout) switch.


Here are all the supported options again:

$ alarm -h
usage: alarm [-h] (-s SECONDS | -m MINUTES) [-b | -d] [-l SONG_LIBRARY | -f FILE | -M MESSAGE] [-v] [-t TIMEOUT]

Play an alarm after N minutes

optional arguments:
  -h, --help            show this help message and exit
  -s SECONDS, --seconds SECONDS
                        Number of seconds before playing alarm (default: None)
  -m MINUTES, --minutes MINUTES
                        Number of minutes before playing alarm (default: None)
  -b, --background      Run timer in the background (default: False)
  -d, --display_timer   Show timer in console (default: False)
  -l SONG_LIBRARY, --song_library SONG_LIBRARY
                        Take a random song from a song library directory, supported formats: .mp3, .mp4, .wav (default: None)
  -f FILE, --file FILE  File path to song to play as alarm (default: None)
  -M MESSAGE, --message MESSAGE
                        Set an audio message to play for alarm (default: None)
  -v, --version         show program's version number and exit
  -t TIMEOUT, --timeout TIMEOUT

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

pybites-alarm-0.0.4.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

pybites_alarm-0.0.4-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file pybites-alarm-0.0.4.tar.gz.

File metadata

  • Download URL: pybites-alarm-0.0.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pybites-alarm-0.0.4.tar.gz
Algorithm Hash digest
SHA256 66ddd6c2b8615094764544d18fa824d99a8fe192432b4fc502a336a9cf93627e
MD5 d1aab9bd0789868ac9cc7fc04bf47ddd
BLAKE2b-256 216e645905b0778219b175d4e6e415487144d21c4168b0d3d6c134eaca6dd6e4

See more details on using hashes here.

File details

Details for the file pybites_alarm-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pybites_alarm-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pybites_alarm-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1d631508ad29e9c292aabaa887c204de8c0e5f004f43a1b6da7c50b34c1f64d6
MD5 d3a11934e9902298452d34df3d7b0ff7
BLAKE2b-256 e6ecbaca60f7d9c72762153fb19065002c973f1132eb6f27785c47508e9176c8

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