Exemplo n.º 1
0
 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"],
     }
Exemplo n.º 2
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"],
     }
Exemplo n.º 3
0
    def read(self) -> pd.DataFrame:
        params = load_query("ireland-metrics", to_str=False)

        data_primary = request_json(self.source_url["primary"], params=params)
        data_primary = self._parse_data_primary(data_primary)

        data_booster = request_json(self.source_url["booster"], params=params)
        data_booster = self._parse_data_boosters(data_booster)

        return pd.merge(data_primary,
                        data_booster,
                        how="outer",
                        on="date",
                        validate="one_to_one")
Exemplo n.º 4
0
def read(source: str) -> pd.DataFrame:
    params = load_query("ireland-metrics", to_str=False)
    data = request_json(source, params=params)
    return parse_data(data)
Exemplo n.º 5
0
 def read(self) -> pd.DataFrame:
     params = load_query("trinidad-and-tobago-metrics", to_str=False)
     data = request_json(self.source, params=params)
     return self._parse_data(data)
Exemplo n.º 6
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)
Exemplo n.º 7
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)