Skip to main content

A package to play an alarm after an interval

Project description

PyBites Alarm

Play a music file after an interval of N minutes. You can configure the tune to play ...

Install the tool

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

Developer setup

$ git clone git@github.com:PyBites-Open-Source/pybites-alarm.git
$ cd pybites-alarm
$ make setup
$ source venv/bin/activate
$ make test

Configure

Create an .env file and add ALARM_MUSIC_FILE to an absolute path of the music file that should play when the timer ends. For example:

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

You can also set ALARM_DURATION_IN_SECONDS=<number_of_seconds_int> to stop the alarm after N seconds.

Usage

$ python -m alarm.alarm -h
usage: alarm.py [-h] (-s SECONDS | -m MINUTES) [-b | -d] [-l SONG_LIBRARY | -f FILE | -v]

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)
  -v, --version         show program's version number and exit

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.2.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

pybites_alarm-0.0.2-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page