This tutorial will tell how you can create a quick list of Covid-19 pandemic real time data list using simple Python Scrip.
For this we are using data API provided by CovidTracking.com. Our example relay on the JSON data file which offer an up to dated covid-19 data set.
Web Request and urllib2
First we need a web request and bring all the JSON object from the internet. Using urllib2 standard Python library we can fetch the web content as follows.
urldata = 'https://covidtracking.com/api/v1/states/current.json' weburl = urllib2.urlopen(urldata) print("result code :" + str(weburl.getcode())) if (weburl.getcode() == 200): data = weburl.read() printData(data) else: print "Some server related error occurs"