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
- Import c3api into your project
from c3covid19 import c3api
- Initialize a
c3api
connection object
cnx=c3api()
- Specify your JSON request as a python dictionary:
germany_request={
"spec": {
"filter": 'id == "Germany"'
}
}
- 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 hereparameters
is the JSON Request you will be posting to the apiapi
is the specific API to hit and defaults tofetch
if not specified.
- 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)