def getData(self, gcs_bucket=None): for group in POVERTY_BY_RACE_SEX_AGE_GROUPS: for is_county in [True, False]: data = None if gcs_bucket is None: data = get_acs_data_from_variables( self.base_url, get_params(group, is_county)) else: data = gcs_to_bq_util.load_values_as_json( gcs_bucket, get_filename(group, is_county)) self.accumulate_acs_data(data)
def getData(self, gcs_bucket=None): for is_county in [True, False]: if gcs_bucket is not None: # LOAD JSON BLOBS FROM GCS data = gcs_to_bq_util.load_values_as_json( gcs_bucket, self.get_filename(is_county) ) else: # LOAD DATA FROM ACS (useful for local debug) data = get_acs_data_from_variables( self.base_url, get_params(HEALTH_INSURANCE_BY_SEX_GROUPS_PREFIX, False), ) # Aggregate and accumulate data in memory self.accumulate_acs_data(data)
def getData(self, gcs_bucket=None): if gcs_bucket is not None: for race in HEALTH_INSURANCE_BY_RACE_GROUP_PREFIXES.values(): for is_county in [True, False]: # Get cached data from GCS data = gcs_to_bq_util.load_values_as_json( gcs_bucket, self.get_filename(race, is_county) ) self.accumulate_acs_data(data) else: for prefix in HEALTH_INSURANCE_BY_RACE_GROUP_PREFIXES: for is_county in [True, False]: data = get_acs_data_from_variables( self.base_url, get_params(prefix, is_county) ) self.accumulate_acs_data(data)