Unified data hub for a better understanding of COVID-19 https://covid19datahub.io
Project description
Python Interface to COVID-19 Data Hub
Python csv parser csv.reader()
does not seem to parse the csv well,
since it cannot work with the quotation marks around strings.
However read_csv()
from pandas is processing it fine.
To make a successful call, you also have to specify User-Agent
header, see here, the request is hence sent separately using requests library.
Install pandas
and requests
by typing into terminal:
pip install pandas requests
Once installed, fetch the data:
# standard library
from io import StringIO
# nonstandard - download separately
import pandas as pd # Pandas
import requests # HTTP Request library
# download
url = "https://storage.covid19datahub.io/data-1.csv"
response = requests.get(url, headers = {"User-Agent": "Mozilla/5.0"})
# make response iterable string
data = StringIO(response.text)
# load into pandas
df = pd.read_csv(data)
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
covid19dh-0.0.1.tar.gz
(2.6 kB
view hashes)
Built Distribution
covid19dh-0.0.1-py3-none-any.whl
(15.2 kB
view hashes)
Close
Hashes for covid19dh-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1489b954acdbaf231d173c5bc3c40bbf5f288af1b65c32b8e6b5c2c2912cc7c0 |
|
MD5 | 716d6a27d4d97056d168e0f073ad1070 |
|
BLAKE2b-256 | bb8123429a8f81d36721281e84cdd9a03e7aca2278d511348f6312d2c516ab12 |