python/datasources/acs_population.py
def upload_to_gcs(self, gcs_bucket):
        """Uploads population data from census to GCS bucket."""
        metadata = fetch_acs_metadata(self.base_acs_url)
        var_map = parse_acs_metadata(metadata, list(GROUPS.keys()))

        concepts = list(SEX_BY_AGE_CONCEPTS_TO_RACE.keys())
        concepts.append(HISPANIC_BY_RACE_CONCEPT)

        file_diff = False
        for concept in concepts:
            group_vars = get_vars_for_group(concept, var_map, 2)
            cols = list(group_vars.keys())
            url_params = get_census_params(cols, self.county_level)
            concept_file_diff = url_file_to_gcs.url_file_to_gcs(
                self.base_acs_url, url_params, gcs_bucket,
                self.get_filename(concept))
            file_diff = file_diff or concept_file_diff

        url_params = get_census_params(
            [TOTAL_POP_VARIABLE_ID], self.county_level)
        next_file_diff = url_file_to_gcs.url_file_to_gcs(
            self.base_acs_url, url_params, gcs_bucket, self.add_filename_suffix(TOTAL_POP_VARIABLE_ID))
        file_diff = file_diff or next_file_diff
        return file_diff
Uploads population data from census to GCS bucket.
Uploads population data from census to GCS bucket.
Uploads population data from census to GCS bucket .
def upload_to_gcs(self, gcs_bucket):
        metadata = fetch_acs_metadata(self.base_acs_url)
        var_map = parse_acs_metadata(metadata, list(GROUPS.keys()))
        concepts = list(SEX_BY_AGE_CONCEPTS_TO_RACE.keys())
        concepts.append(HISPANIC_BY_RACE_CONCEPT)
        file_diff = False
        for concept in concepts:
            group_vars = get_vars_for_group(concept, var_map, 2)
            cols = list(group_vars.keys())
            url_params = get_census_params(cols, self.county_level)
            concept_file_diff = url_file_to_gcs.url_file_to_gcs(
                self.base_acs_url, url_params, gcs_bucket,
                self.get_filename(concept))
            file_diff = file_diff or concept_file_diff
        url_params = get_census_params(
            [TOTAL_POP_VARIABLE_ID], self.county_level)
        next_file_diff = url_file_to_gcs.url_file_to_gcs(
            self.base_acs_url, url_params, gcs_bucket, self.add_filename_suffix(TOTAL_POP_VARIABLE_ID))
        file_diff = file_diff or next_file_diff
        return file_diff
def upload_to_gcs ( self , gcs_bucket ) : metadata = fetch_acs_metadata ( self . base_acs_url ) var_map = parse_acs_metadata ( metadata , list ( GROUPS . keys ( ) ) ) concepts = list ( SEX_BY_AGE_CONCEPTS_TO_RACE . keys ( ) ) concepts . append ( HISPANIC_BY_RACE_CONCEPT ) file_diff = False for concept in concepts : group_vars = get_vars_for_group ( concept , var_map , 2 ) cols = list ( group_vars . keys ( ) ) url_params = get_census_params ( cols , self . county_level ) concept_file_diff = url_file_to_gcs . url_file_to_gcs ( self . base_acs_url , url_params , gcs_bucket , self . get_filename ( concept ) ) file_diff = file_diff or concept_file_diff url_params = get_census_params ( [ TOTAL_POP_VARIABLE_ID ] , self . county_level ) next_file_diff = url_file_to_gcs . url_file_to_gcs ( self . base_acs_url , url_params , gcs_bucket , self . add_filename_suffix ( TOTAL_POP_VARIABLE_ID ) ) file_diff = file_diff or next_file_diff return file_diff
Uploads population data from census to GCS bucket.
Uploads population data from census to GCS bucket .
"""Uploads population data from census to GCS bucket."""
self
gcs_bucket