c3covid19

Python wrapper for easy use of the C3 COVID 19 Data Lake


Keywords
data, lake, covid19, c3, c3covid19
License
MIT
Install
pip install c3covid19==0.2

Documentation

c3covid19

Python wrapper for easy use of the C3 Covid 19 Data Lake.

Full API Documentation

https://connor-makowski.github.io/c3covid19/

Features

  • Simplified python access to the c3 data lake.

Setup

Make sure you have Python 3.6.x (or higher) installed on your system. You can download it here.

Installation

pip install c3covid19

Quick Start

  1. Import c3api into your project
from c3covid19 import c3api
  1. Initialize a c3api connection object
cnx=c3api()
  1. Specify your JSON request as a python dictionary:
germany_request={
  "spec": {
    "filter": 'id == "Germany"'
  }
}
  1. request from the connection object:
germany=cnx.request(data_type='outbreaklocation', parameters=germany_request, api='fetch')
  • Notes:
    • data_type is the data "Type" as specified by the c3.ai covid19 documentation here
    • parameters is the JSON Request you will be posting to the api
    • api is the specific API to hit and defaults to fetch if not specified.
  1. Print the results:
print(germany)

Output Data

Output data will be in the format set by the C3 Covid19 Data Lake team. See their documentation here.

Full Example

from c3covid19 import c3api

cnx=c3api()
germany_request={
  "spec": {
    "filter": 'id == "Germany"'
  }
}

germany=cnx.request(data_type='outbreaklocation', parameters=germany_request)

print(germany)