A simple python script to fetch the latest covid info
How it works
- First, get the current date in MM-DD-YYYY format.
- Check if the csv database for that date exists abd has been downloaded. If not, download it using wget from CSSEGISandData/COVID-19.
- If wget throws error(meaning that the database does not exist for that day), decreament the day by one.
- Go back to step 2 until the latest covid info has been downloaded.
- Open the file with csv reader.
- Ask the user for input of a province or a country.
WARNING: The input is case sensitive so make sure to put the first letters in caps and the rest in small.
- If a province or a country exists (ex. "New York", "Nagasaki"), then print the latest covid info of that place. If not, print nothing.
- Go back to step 6 until the user gives interrupt or gives
Please make sure to install the pip python module before running the script.
- Run command prompt as administrator.
- Go to Start > Windows System > Right click on command prompt and run as administrator. OR
Windows Key + Rand type
cmd. Then press
Ctrl + Shift + Enter.
pip install wget.