Skip to content
Advertisement

Defining path for downloaded CSV file in python3

I’m successfully able to download CSV files from a folder on Exavault, using the files provided by Exavault, but the download gets saved in a temporary folder on my Mac.

How do I define the directory to save it to? This is an excerpt of the script.

JavaScript

Separately there’s a resources_api.py file, which might hold the answer, but if I edit that, I’m not sure how I would invoke the changes.

Any help would be appreciated.

Advertisement

Answer

When looking at the code of the API, you can see that it is written such that it always creates a temporary folder for you:

JavaScript

You could check if you can try to change api_client.configuration.temp_folder_path and see if that works for you.

Or even better, just copy the file to a location of your choice. You can do it with shutil

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement