コード例 #1
0
def read(url: str) -> pd.Series:
    date_str = parse_date(run_query(url, load_query("philippines-date")))
    return pd.Series(
        data={
            "total_vaccinations":
            run_query(url, load_query("philippines-total-vaccinations")),
            "people_vaccinated":
            run_query(url, load_query("philippines-people-vaccinated")),
            "people_fully_vaccinated":
            run_query(url, load_query("philippines-people-fully-vaccinated")),
            "date":
            date_str
        })
コード例 #2
0
ファイル: ireland.py プロジェクト: wenjian80/covid-19-data
 def parse_doses(self) -> str:
     params = load_query('ireland-doses', to_str=False)
     data = requests.get(self.endpoint_doses, params=params).json()
     res = data["features"][0]["attributes"]
     return {
         "dose_1": res['firstDose'],
         "dose_2": res['secondDose'],
         "date": res['relDate']
     }
コード例 #3
0
 def parse_vaccines_manufacturer(self):
     params = load_query('ireland-doses-manufacturer', to_str=False)
     data = requests.get(self.endpoint_vaccines_manufacturer, params=params).json() 
     res = data["features"][0]["attributes"]
     return {
         "pfizer": res['pf'],
         "oxford": res['az'],
         "moderna": res['modern'],
         "johnson": res['janssen'],
         "date_": res['relDate']
     }
コード例 #4
0
def read(source: str) -> pd.DataFrame:
    params = load_query("trinidad-and-tobago-metrics", to_str=False)
    data = requests.get(source, params=params).json()
    return parse_data(data)
コード例 #5
0
 def read(self) -> pd.Series:
     params = load_query('poland-all', to_str=False)
     data = requests.get(self.source_url,
                         params=params).json()["features"][0]["attributes"]
     return pd.Series(data)