Last active
April 24, 2017 23:17
-
-
Save pjgranahan/5f24a396e109c4f8868e5f3c2dba9346 to your computer and use it in GitHub Desktop.
Upload folder contents to AWS S3 with Boto3 using Python 3.5+. A simpler alternative to https://gist.github.com/feelinc/d1f541af4f31d09a2ec3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_dir_to_s3(directory): | |
for file_path in Path(directory).glob('**/*.*'): | |
site_bucket.upload_file(file_path.__str__(), file_path.relative_to(directory).__str__()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment