Skip to main content

A covid dashboard providing the latest Covid information. To be used for demonstration.

Project description

Introduction

This project is a simple covid dashboard that provides the latest covid statistics for an area as well the top covid related headlines for the nation. The dashboard is customisable, you can choose any area within the UK to have statistics from and you can update the news and covid data whenever you would like.

Prerequisites Installations

This project was developed on python 3.10.0 prior versions of python may not run the project as intended.

The project uses several extrernal python libraries which are listed below along with the pip command required to install the library.

  • UK Covid-19 API service - pip install uk-covid19
  • Requests - pip install requests
  • Flask - pip install Flask

How to use the dashboard

First run the main.py file. This can be done through the command line by setting the current directory to dashboard_pkg and then running:

$ python "your directory path\Covid CA\dashboard_pkg\main.py"

After doing this open a web browser and enter the IP address http://127.0.0.1:5000/index into the search bar. The dashboard will then be loaded. It is fairly simple to understand and each bit of functionality is clearly labelled.

To customise the dashboard you need to find the config.txt file which is located within the dashboard_pkg folder. The values stored and how they can be changed are as followed:

  • location - This can be changed to any area recognised by the UK covid API. The easiest way to find these areas is to use the UK covid interactive map of cases. When you click on a location it will list it's full area name which must be entered correctly into the config file.
  • nation - Can either be 'England','Wales','Scotland' or 'Northern Ireland'.
  • areaType - Can eiter be 'utla', 'ltla' or 'msoa'. To find out what type an area is use the intercative map again. It is listed directly under it's name.
  • APIKey - Not to be changed unless you fully understand it's usage.

Testing

Included within dashboard_pkg is a folder called tests. These test are able to be ran with pytest to test the code still runs as intended. To run these tests yourself you must first install pytest with the command:

$ pip install pytest

Then set your current directory to dashboard_pkg. Finally, run the command:

$ python-m pytest

You will then be provided with a breakdown of the tests and whether the modules passed or failed.

Developer Documentation

The project consists of 3 modules. covid_data_handler.py, covid_news_handling.py and main.py.

  • covid_data_handler.py contains functions related to handling the extraction and processing of covid data. There are functions related to extracting data from both a csv file and the UK covid API service. There is also a function to calculate the interval in seconds from the current time to an entered time. This is used for scheduling updates.
  • covid_news_handling.py is responsible for calling NewsAPI's service to return the top Covid related articles in the UK. It also ensures the articles being returned haven't been seen before and the list of articles is of suitable size.
  • main.py imports functions from both other modules to create the project's user interface. It utilises the Flask library to do this. There are also additional functions related to the scheduling and remival of updates.

For a more thorough breakdown of each module and it's functions visit the documentation page.

Additional Information

For license information see LICENSE.txt

Author - Matt Trenchard

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dashboard-pkg-mtrenchard-1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

dashboard_pkg_mtrenchard-1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file dashboard-pkg-mtrenchard-1.0.tar.gz.

File metadata

  • Download URL: dashboard-pkg-mtrenchard-1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for dashboard-pkg-mtrenchard-1.0.tar.gz
Algorithm Hash digest
SHA256 e4027d87c29b9c1c6856d94afdaa2a297b4ecf38eb2a713edc9863b769370fba
MD5 4285dac80e3976d566610718c75991d9
BLAKE2b-256 b0bfc26383c2fe110b28f1c652da1401284ad589cb52405033c4e9fff362308a

See more details on using hashes here.

File details

Details for the file dashboard_pkg_mtrenchard-1.0-py3-none-any.whl.

File metadata

  • Download URL: dashboard_pkg_mtrenchard-1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for dashboard_pkg_mtrenchard-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa43b987b18353e24b7671d64a06961780261a99e5502d7cff635d9351341b6c
MD5 9f02e40147e1de6d14e5db9c03d67205
BLAKE2b-256 f78d7f3ffaced03b25351c7545af2ab4a2592411057e21839ced65d538541fda

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