Skip to content
Snippets Groups Projects
Commit 2c8dd565 authored by Constance de Quatrebarbes's avatar Constance de Quatrebarbes
Browse files

Update to_source_data: revert to filepath based on url

parent c087d0b3
No related branches found
No related tags found
1 merge request!1Implement download script and more
......@@ -199,11 +199,13 @@ def main():
excel_data = fetch(ds)
for file in excel_data:
response = requests.get(file["f_url"])
excel_file_path = os.path.join(target_dir, file["f_title"])
#reverting back to url filepath
filepath = file["f_url"].split("/")[-1]
excel_file_path = os.path.join(target_dir, filepath)
with open(excel_file_path, "wb") as excel_file:
excel_file.write(response.content)
subprocess.check_call(
['git', 'add', file["f_title"]],
['git', 'add', filepath],
cwd=target_dir,
)
# Note: Ignore error occuring when there is nothing to commit.
......
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