Download files from S3 using Python
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
In the past, I would open a browser and select the S3 file(s) or use Alteryx workflow with S3 download tool. S3 download tool works great if the daily file follows the proper naming convention and it kicks off at the scheduled time - file includes the execution timestamp. Then a macro can easily pull the file with today's date.
But.... if the file runs at another time. Back to opening Edge/Chrome and downloading it manually.
I came across a great article Amazon S3 Download – Use Wildcards to Select a Single or Multiple Objects - Alteryx Community sélect...
With this great idea from @DanC, wrote some Python code to pull any files generated today. See below using the Python tool:
Note my variables for AccessKey, SecretKey, and BucketName. Other than that, it's just the bottom two cells. After a few blanks, figured out Package.installPackages(['boto3']) was missing. Then it ran fine, also on Alteryx Server.
Hope this helps you, too!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi ,
Please refer to the link below which is part of the tool mastery series of Alteryx. It also comprises of the issues and resolutions as well
Hope this helps!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My post is how to do it dynamically instead of the usual S3 download tool's way. That is the key point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Would this work with .gz files in the s3 bucket? If not, do you know how to adapt it so it would? The inbuilt connector does not allow .gz file downloads.
Thanks!
