Skip to main content

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


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.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

covid19dh-0.0.3-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file covid19dh-0.0.3.tar.gz.

File metadata

  • Download URL: covid19dh-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3rc1

File hashes

Hashes for covid19dh-0.0.3.tar.gz
Algorithm Hash digest
SHA256 2f8a9056b788544cef051bd821b94d3d9441c95ab0360c25d2e6b0115d4b97fe
MD5 563cf0c4800081b89c05b81d5efc051d
BLAKE2b-256 a934868b1b3227d71d2621963cf023c704efb7efee440e1b2fadf300717223d7

See more details on using hashes here.

File details

Details for the file covid19dh-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: covid19dh-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3rc1

File hashes

Hashes for covid19dh-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 87438175f8f12896a0783239beb2b75c4d7e70ea6d75b7e1f83404ddc1219ccd
MD5 99cb3f51c67d88fd00b580e38ea0191a
BLAKE2b-256 6a43de3baa435d3e3f55f0ad7317af464f0cdafde5117922f732f0168aa86ece

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page