Lightweight covid dashboard
Project description
Covid Dashboard
introduction
The purpose of the project is to gather and process data of the Sars-cov-2 virus and the coronavirus/covid-19 disease.
The end goal is to have reliable data taken from the governments Covid-19 API and the news API in a readable UI with up to date data.
Prerequisites
Internet connection to access multiple APIs
Developed on python 3.8.3
Installation
Dependencies
- Flask
- Requests
- pytest
- sched
Getting started tutorial
Ensure all dependencies are installed The main app is 'Covid_dashboard' and calls other modules on requirement nation_2021_10_28.csv is included for testing purposes
Testing
Tests can be run from the // directory They will automatically run to ensure the program is running correctly
Developer Documentation
covid_data_handler
Function(parse_csv_data: str) -> list: '''This takes argument=string as a csv filename and reads the data and writes it to a list object'''
Function(process_csv_data: list) -> dict: '''This takes the list object returned by Function(parse_csv_data) and returns those statistics'''
Function(covid_API_request: str) -> dict: '''This updates the csv using the COVID-19 API ''' API documentation: https://coronavirus.data.gov.uk/details/developers-guide
Function(schedule_covid_updates) '''schedules the covid_API_request function to run at a given interval'''
covid_news_handling
Function(todays_date: int) -> str: '''returns today's date as a string with format YYYY-MM-DD'''
Function(news_API_request: str) -> dict: '''This updates the news articles using the news api''' API documentation: https://newsapi.org/docs
Function(update_news) '''This schedules the news_API_request function'''
covid_dashboard
Function(Index) '''This tells the program to render the dashboard from the index.html template'''
Function(data_assign) '''This assigns data to output variables using parse_csv_data and process_csv_data'''
Function(update_news: int) -> dict '''This calls for news to be updated on schedule'''
Function(update_data) '''This calls for data to be updated on shcedule'''
Function(update_articles: int) -> list: '''This updates the news articles and adds them to the dashboard'''
Function(time_to_sec: str) -> int: '''Converts HH:MM:SS to seconds'''
Function(sec_to_time:int ) -> str: '''Converts seconds to HH:MM:SS'''
Function(time_difference: int) -> str: '''Takes time difference in seconds and returns time difference in HH:MM:SS'''
Function(start_time) '''When the program makes a request this makes a timestamp'''
Function(log_requests) '''Tells the logger to log the specified data when a response is given'''
Details
Author: Ryan Toffoletti
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Covid_dashboard-pkg-rt539-1.0.1.tar.gz.
File metadata
- Download URL: Covid_dashboard-pkg-rt539-1.0.1.tar.gz
- Upload date:
- Size: 4.0 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.23.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba624b29be7783f7d3c68f676049547daefe623037252911316f1ff9b0cb67b4
|
|
| MD5 |
f80625f8e12810157b85741430d9f682
|
|
| BLAKE2b-256 |
f53237b2fcc44f807d41a6129a45b125947505b29b88facd4d1613f687f266d2
|
File details
Details for the file Covid_dashboard_pkg_rt539-1.0.1-py3-none-any.whl.
File metadata
- Download URL: Covid_dashboard_pkg_rt539-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.7 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.23.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d73602bb1dd7d947cc3e48f6c893f1df67ece3cd805fdaacdc44b2f2bc275bf5
|
|
| MD5 |
01f520710e0ba07cbd4633870d6c81ec
|
|
| BLAKE2b-256 |
c414c59b2a1220f28d74de1695b1c151de5940c06cb8ecc48feadb6f50232ee5
|