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

Download: add dataset.json files

parent 477186ee
......@@ -104,6 +104,7 @@ def main():
# Get available frequencies for this dataset
dataset_frequencies = get_from_api(API_URLs['series_frequencies'].format(api_user_id=api_user_id, dataset_code=dataset_code))['ParamValue']
nb_tables_downloaded = 0
dataset_json = [] # Data to be written to dataset.json
# For each "table" (set of series)
for table_info in tables_list["ParamValue"]:
table_code = table_info.get('TableName') or table_info.get('TableNumber')
......@@ -122,6 +123,14 @@ def main():
if json:
write_json_file(table_filepath, json)
nb_tables_downloaded += 1
dataset_json.append({
'table_code': table_code,
'dimension_label': 'FREQ',
'dimension_code': frequency_code,
'filename': table_filename,
})
# Write dataset.json
write_json_file(os.path.join(dataset_path, "dataset.json"), dataset_json)
log.info('END')
......
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