covid19-etl/etl/vac_tracker.py
def parse_file(self, url):
        """
        Converts a json file to data we can submit via Sheepdog. Stores the
        records to submit in `self.location_data` and `self.time_series_data`.
        Ignores any records that are already in Sheepdog (relies on unique
        `submitter_id` to check)

        Args:
            url (str): URL at which the file is available
        """
        print("Getting data from {}".format(url))
        with closing(self.get(url, stream=True)) as r:
            data = r.json()
            try:
                for treatment in data["result"]["pageContext"]["treatments"]:
                    node = treatment["node"]
                    clinical_trial = self.parse_node(node)
                    self.clinical_trials.append(clinical_trial)
            except ValueError as e:
                print(f"ERROR: value error. Detail {e}")

        Converts a json file to data we can submit via Sheepdog. Stores the
        records to submit in `self.location_data` and `self.time_series_data`.
        Ignores any records that are already in Sheepdog (relies on unique
        `submitter_id` to check)

        Args:
            url (str): URL at which the file is available
        
Converts a json file to data we can submit via Sheepdog.
Converts a json file to data we can submit via Sheepdog .
def parse_file(self, url):
        print("Getting data from {}".format(url))
        with closing(self.get(url, stream=True)) as r:
            data = r.json()
            try:
                for treatment in data["result"]["pageContext"]["treatments"]:
                    node = treatment["node"]
                    clinical_trial = self.parse_node(node)
                    self.clinical_trials.append(clinical_trial)
            except ValueError as e:
                print(f"ERROR: value error. Detail {e}")
def parse_file ( self , url ) : print ( "Getting data from {}" . format ( url ) ) with closing ( self . get ( url , stream = True ) ) as r : data = r . json ( ) try : for treatment in data [ "result" ] [ "pageContext" ] [ "treatments" ] : node = treatment [ "node" ] clinical_trial = self . parse_node ( node ) self . clinical_trials . append ( clinical_trial ) except ValueError as e : print ( f"ERROR: value error. Detail {e}" )
Converts a json file to data we can submit via Sheepdog.
Converts a json file to data we can submit via Sheepdog .
"""
        Converts a json file to data we can submit via Sheepdog. Stores the
        records to submit in `self.location_data` and `self.time_series_data`.
        Ignores any records that are already in Sheepdog (relies on unique
        `submitter_id` to check)

        Args:
            url (str): URL at which the file is available
        """
self
url
URL at which the file is available
URL at which the file is available