I have a python function to download csv files from AWS S3 Bucket. The folder I want to download from has a lot of csv files with various naming conventions and out of all those, I want to download files that contain a certain substring.
The files I want to download are named as:
BANK_NIFTY_5MINs_2020-01-01.csvBANK_NIFTY_5MINs_2020-01-02.csvBANK_NIFTY_5MINs_2020-01-03.csvand so on.
I do not want to download all the csv files from the folder of 2020, just the csv files that have the substring. Can someone please help on how I can do that?
The below code is where I run the function but this does not download the data:
download_from_s3(s3_uri="s3://dir1/dir2/dir3/2020/BANK_NIFTY_5MINs*.csv", local_dir=os.path.join("2020Data"))
How can I specify the substring of the csv files I want to download?
download_from_s3()method is not offered directly by boto3. Are you using a library of some sort to access S3? (eg Anaconda?)