Skip to content

Instantly share code, notes, and snippets.

@pjgranahan
pjgranahan / UploadDirS3.py
Last active April 24, 2017 23:17
Upload folder contents to AWS S3 with Boto3 using Python 3.5+. A simpler alternative to https://gist.github.com/feelinc/d1f541af4f31d09a2ec3
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__())