Last active
October 30, 2021 16:51
-
-
Save anteverse/d5c5c1635b3fab188b4dc3fd84ef1a98 to your computer and use it in GitHub Desktop.
Remove the disk usage
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
zip_obj = s3_resource.Object("path/to/key.zip") | |
buffer = BytesIO(zip_obj.get()["Body"].read()) | |
with ZipFile(buffer) as zipfile: | |
for file_name in zipfile.namelist(): | |
s3_client.upload_fileobj( | |
fileobj=zipfile.open(file_name), | |
Bucket="my_bucket", | |
Key=f"some_prefix/{file_name}", | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment