Skip to content
Snippets Groups Projects
Commit 0c92afa0 authored by Enzo Buthiot's avatar Enzo Buthiot
Browse files

Correct mistake

parent c63c6c6f
No related branches found
No related tags found
No related merge requests found
Pipeline #255714 passed with stage
in 14 minutes and 17 seconds
......@@ -52,6 +52,7 @@ def download_file(path: Path, url):
zip_ref.extractall(path) # extract file to dir
zip_ref.close() # close file
os.remove(file_name) # delete zipped file
return zip_list
def download_dataset_json(path: Path, url):
......@@ -110,12 +111,12 @@ def main():
# Download flags.json
download_flag_json(target_dir, flag_url)
# Download main FAO file
download_file(target_dir, url)
# Download main FAO file and return zip_list
zip_list = download_file(target_dir, url)
# Create zip_dict where key = zip name and value = csv name,
# then save it to target directory
zip_dict = dict()
zip_file = zipfile.ZipFile('/Users/EnzoButhiot/Downloads/FAOSTAT.zip', 'r')
zip_list = zip_file.namelist()
for name in zip_list:
if name not in zip_dict.keys():
zip_dict[name] = ''
......
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