Metadata-Version: 2.1
Name: covid19dh
Version: 0.0.2
Summary: Unified data hub for a better understanding of COVID-19 https://covid19datahub.io
Home-page: https://www.covid19datahub.io/
Author: Covid-19 Data Hub
Author-email: martinbenes1996@gmail.com
License: GPL
Download-URL: https://github.com/covid19datahub/Python/archive/0.0.2.tar.gz
Keywords: 2019-nCov,coronavirus,covid-19,covid-data,covid19-data
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Other Audience
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Description-Content-Type: text/markdown

# 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](https://pandas.pydata.org/) is processing it fine.

To make a successful call, you also have to specify `User-Agent` header, see [here](https://datascience.stackexchange.com/questions/49751/read-csv-file-directly-from-url-how-to-fix-a-403-forbidden-error), the request is hence sent separately using [requests](https://requests.readthedocs.io/en/master/) library.

Install `pandas` and `requests` by typing into terminal:

```bash
pip install pandas requests
```

Once installed, fetch the data:

```python
# 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)
```


