Commit e0994d46 authored by Bruno Duyé's avatar Bruno Duyé

Minor: variables renaming

parent 87ef3c6c
......@@ -63,7 +63,7 @@ DATASETS_TO_DOWNLOAD = [
API_URLs = {
'tables_list': 'https://bea.gov/api/data/?&UserID={api_user_id}&method=GetParameterValues&DataSetName={dataset_code}&ParameterName=TableName',
'series_frequencies': 'https://bea.gov/api/data/?&UserID={api_user_id}&method=GetParameterValues&DataSetName={dataset_code}&ParameterName=Frequency',
'series_data': 'https://www.bea.gov/api/data/?&UserID={api_user_id}&method=GetData&DataSetName={dataset_code}&TableName={table_name}&Frequency={frequency_code}&Year=ALL',
'series_data': 'https://www.bea.gov/api/data/?&UserID={api_user_id}&method=GetData&DataSetName={dataset_code}&TableName={table_code}&Frequency={frequency_code}&Year=ALL',
}
API_ERRORS_WHITELIST = [
......@@ -113,8 +113,10 @@ def main():
break
for frequency_dict in dataset_frequencies:
frequency_code = frequency_dict['FrequencyID']
url = API_URLs['series_data'].format(api_user_id=api_user_id, dataset_code=dataset_code, table_name=table_name, frequency_code=frequency_code)
table_filepath = os.path.join(dataset_path, slugify(table_name) + '-' + frequency_code + '.json')
url = API_URLs['series_data'].format(api_user_id=api_user_id, dataset_code=dataset_code,
table_code=table_code, frequency_code=frequency_code)
table_filename = slugify(table_code) + '-' + frequency_code + '.json'
table_filepath = os.path.join(dataset_path, table_filename)
json = get_from_api(url, raise_on_errors=False)
if json:
write_json_file(table_filepath, json)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment