What do you want to save?
Add Code snippet
New code examples
-
-
Other 2022-02-28 19:05:02
handle s3 exceptions boto3
import boto3 from botocore.exceptions import ClientError try: iam = boto3.client('iam') user = iam.create_user(UserName='fred') print("Created user: %s" % user) except ClientError as e: if e.response['Error']['Code'] == 'EntityA... Add solution -
-
Python 2022-01-22 13:40:54
json textract response
# Call Amazon Textract and get JSON response # client = boto3.client('textract') # response = client.analyze_document(Document={...}, FeatureTypes=[...]) # Parse JSON response from Textract doc = Document(response) # Iterate over elements in the docum... Add solution -
Other 2021-10-16 20:52:07
download files from s3 bucket filtered by date
from boto3.session import Session from datetime import date, timedelta import boto3 import re def Download_pdf_specifc_date_subfolder(bucket_name,download_path) ACCESS_KEY = 'XYZ' SECRET_KEY = 'ABC' Bucket_name=bucket_name # code to cre... Add solution -
Python 2021-10-14 03:49:08
boto3 create bucket
import logging import boto3 from botocore.exceptions import ClientError def create_bucket(bucket_name, region=None): """Create an S3 bucket in a specified region If a region is not specified, the bucket is created in the S3 defau... Add solution