Skip to main content

COVID-19 Alarm Clock

Project description

Covid-19 Alarm Clock

Introduction

The purpose of this project was to create a dynamic alarm clock which can provide regular updates on covid-19 cases, the news and the weather. Users can choose to submit alarm clocks will always provide a local covid-19 update with options to include top news stories and/or local weather. These alarm clocks will use vocal announcements. Additionnaly, text based notifications will be updated regularly providing covid-19, news and weather updates.

Prerequisites

This project was written in Python 3. The user will need a working Python 3 interpreter. The user will also need git installed.

Installation

You can dowload the package from Github using:

$ git clone https://github.com/ElladanGE
$ cd COVID_AlarmClock

Create a new virtual environment using:

python3 -m venv <DIR>
source <DIR>/bin/activate

And then activate it using:

python3 -m venv <DIR>
source <DIR>/bin/activate

Additionnal packages required:

  • pyttsx3
  • flask
  • requests
  • json
  • uk-covid19
  • sched
  • time
  • logging

If you do not have these packages pre-installed, you can download them using:

$ pip install <package name>

Getting started

First you will have to create your config file which must have the name:

config_file.json

Inside this file you must use this structure:

{
    "API_keys": {
      "news" : "<your news API key here>",
      "weather" : "<your weather API key here>"
    },
    "Location": {
      "my-city" : "<city name>",
      "country" : "gb"
    },
    "News-sources": {
      "my-sources": ["<source1", ..., "<sourceN>"]
    },
    "Notif_period": {
      "time": "<notification update time in seconds>"
    }
}

Once you have done this, save it in \COVID_AlarmClock\App.

Voila, the program is now ready to run. To run the program, in \COVID_AlarmClock> simply type:

python main.py

Usage

You can now go to:

http://127.0.0.1:5000/

To access the alarm clock.

To set alarm, select a date and time, select if you want to include news and/or weather, add a label and press submit. The name of your alarm clock, when it is set and it's content should now appear on the left. On the right hand side, you will see 3 notification boxes. One for COVID update, one for news and one for weather. These notifications will regurlaly be updated depending on what delay you put in the config file. The news stories will be the top news articles from the sources you provided and the weather will be the local weather from the city you provided.

Testing

To run the test, in \COVID_AlarmClock directory, simply type:

$ pytest

Developper documentation

Tree

* COVID_AlarmClock
    * static
        * Images
            * favincon.jpg
        * style.css
    * templates
        * template.html
    * tests
        * __init__.py
        * gb-news.json
        * test_main.py
    * App
        * __init__.py
        * main.py
        * config_file.json
        * timer_conversion.py
    * license.md
    * README.md
    * setup.py

Details

Author

  • Duncan Watson

Link to source

Link to Github

Licence

This project is licensed under the MIT Licence - see the license.md for details.

Acknowledgements

I would like to thank Dr. Matt Collison and all the TA's for their help during the developpement of this project.

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

Covid19AlarmClock-0.0.1.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

Covid19AlarmClock-0.0.1-py3-none-any.whl (9.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