import boto3 def read_s3_file(bucket_name, file_name): s3 = boto3.client('s3') try: response = s3.get_object(Bucket=bucket_name, Key=file_name) return response['Body'].read().decode('utf-8') except Exception as e: print(f"Error reading file from S3: {e}") return None