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.2.tar.gz
(3.3 kB
view hashes)
Built Distribution
covid19dh-0.0.2-py3-none-any.whl
(15.9 kB
view hashes)
Close
Hashes for covid19dh-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63279d2b7edf39bad64c86c343420cddd89d5ede3691ca697856520b74d0cd53 |
|
MD5 | 7361a2f5be0c08d126252c0de963b74a |
|
BLAKE2b-256 | 6dc90212c325e49e2ac15123e9081c039b7a02c44d5a0683f5a5e812c40e82e2 |