covid19-etl/etl/idph_vaccine_to_s3.py
def files_to_submissions(self):
        """
        Get the existing vaccine data from S3, query Peregrine for any new
        data, and create an updated JSON file with existing + new data.
        """
        existing_data = self.get_existing_data_from_s3()
        last_updated_date = existing_data["last_updated"]
        if last_updated_date:
            last_updated_date = datetime.strptime(last_updated_date, "%Y-%m-%d")
            days_since_last_update = (datetime.now() - last_updated_date).days
            print(
                f"Data in S3 up to {last_updated_date}; querying Peregrine for the last {days_since_last_update} days of data"
            )
        else:
            days_since_last_update = None

        if days_since_last_update == 0:
            print("Zero days since last update: nothing to do")
            return

        new_data = self.get_new_data_from_peregrine(days_since_last_update)
        county_to_fips_dict = get_county_to_fips_dictionary()
        result = self.format_result(county_to_fips_dict, existing_data, new_data)

        # save to local
        with open(
            os.path.join(CURRENT_DIR, VACCINES_BY_COUNTY_BY_DATE_FILENAME), "w"
        ) as f:
            f.write(
                json.dumps(
                    result,
                    separators=(",", ":"),
                )
            )

        Get the existing vaccine data from S3, query Peregrine for any new
        data, and create an updated JSON file with existing + new data.
        
Get the existing vaccine data from S3, query Peregrine for any new
data, and create an updated JSON file with existing + new data.
Get the existing vaccine data from S3 query Peregrine for any new data and create an updated JSON file with existing + new data .
def files_to_submissions(self):
        existing_data = self.get_existing_data_from_s3()
        last_updated_date = existing_data["last_updated"]
        if last_updated_date:
            last_updated_date = datetime.strptime(last_updated_date, "%Y-%m-%d")
            days_since_last_update = (datetime.now() - last_updated_date).days
            print(
                f"Data in S3 up to {last_updated_date}; querying Peregrine for the last {days_since_last_update} days of data"
            )
        else:
            days_since_last_update = None
        if days_since_last_update == 0:
            print("Zero days since last update: nothing to do")
            return
        new_data = self.get_new_data_from_peregrine(days_since_last_update)
        county_to_fips_dict = get_county_to_fips_dictionary()
        result = self.format_result(county_to_fips_dict, existing_data, new_data)
        with open(
            os.path.join(CURRENT_DIR, VACCINES_BY_COUNTY_BY_DATE_FILENAME), "w"
        ) as f:
            f.write(
                json.dumps(
                    result,
                    separators=(",", ":"),
                )
            )
def files_to_submissions ( self ) : existing_data = self . get_existing_data_from_s3 ( ) last_updated_date = existing_data [ "last_updated" ] if last_updated_date : last_updated_date = datetime . strptime ( last_updated_date , "%Y-%m-%d" ) days_since_last_update = ( datetime . now ( ) - last_updated_date ) . days print ( f"Data in S3 up to {last_updated_date}; querying Peregrine for the last {days_since_last_update} days of data" ) else : days_since_last_update = None if days_since_last_update == 0 : print ( "Zero days since last update: nothing to do" ) return new_data = self . get_new_data_from_peregrine ( days_since_last_update ) county_to_fips_dict = get_county_to_fips_dictionary ( ) result = self . format_result ( county_to_fips_dict , existing_data , new_data ) with open ( os . path . join ( CURRENT_DIR , VACCINES_BY_COUNTY_BY_DATE_FILENAME ) , "w" ) as f : f . write ( json . dumps ( result , separators = ( "," , ":" ) , ) )
Get the existing vaccine data from S3, query Peregrine for any new
data, and create an updated JSON file with existing + new data.
Get the existing vaccine data from S3 query Peregrine for any new data and create an updated JSON file with existing + new data .
"""
        Get the existing vaccine data from S3, query Peregrine for any new
        data, and create an updated JSON file with existing + new data.
        """ # save to local
self