amazon-s3

Does anyone know how I can read PDFs off of a S3 bucket using `pdfplumber`?

Does anyone know how I can read PDFs off of a S3 bucket using `pdfplumber`? Question: I’m trying to read PDF files that are stored in a S3 bucket, using a Python package called pdfplumber. I tried the following approaches, but none of them has worked. Does anyone know how I can read PDFs off …

Total answers: 1

Copy and Rename files in S3 bucket Lambda

Copy and Rename files in S3 bucket Lambda Question: I am writing a lambda function to test the tables in Athena and I have gotten that part to work. I am trying to rename the ResultConfiguration outputlocation file name that the function creates which cannot be renamed unless it’s copied and deleted. I am getting …

Total answers: 1

Error No file found while converting file present in s3 using boto3

Error No file found while converting file present in s3 using boto3 Question: I have a csv files present in s3 I am able to print bucket name, key and file content But while converting to json I am getting Error no file found There is only one csv file which is of 1 KB …

Total answers: 2

How to assign the url of the uploaded photo from AWS to database(postgresql) model in the same endpoint

How to assign the url of the uploaded photo from AWS to database(postgresql) model in the same endpoint Question: Below that there is an endpoint that uploads a photo to aws-s3 and return the url of the photo. This works well. session1 = boto3.Session( aws_access_key_id=’XXXXXXXXXX’, aws_secret_access_key=’XXXXXXXXX’ ) S3_BUCKET_NAME = "XXXXX" s3 = session1.resource("s3") bucket = …

Total answers: 2

Cannot find AWS_KEY_ID to connect to Boto3

Cannot find AWS_KEY_ID to connect to Boto3 Question: I am just getting started using Boto3 to connect to AWS, and I cannot get it to work. This is my code: #client client = boto3.client(‘s3’) list_bucket=client.list_buckets() print(list_bucket) This is the error message I receive: botocore.exceptions.NoCredentialsError: Unable to locate credentials I tried to set up CLI access …

Total answers: 1

Custom endpoint for `ros3` driver in `h5py`

Custom endpoint for `ros3` driver in `h5py` Question: h5py supports the native S3 driver for HDF5 (the ros3 driver). We’ve enabled this with a local build of HDF5. >>> import h5py >>> >>> print(f’Registered drivers: {h5py.registered_drivers()}’) Registered drivers: frozenset({ ‘ros3’, ‘sec2’, ‘fileobj’, ‘core’, ‘family’, ‘split’, ‘stdio’, ‘mpio’}) We have a custom endpoint for our S3 …

Total answers: 1

Lambda function triggered when adding files to a S3 bucket

Lambda function triggered when adding files to a S3 bucket Question: I am having a problem with the behavior of a Lambda function. Ultimately, I want my lambda function to read some information about json files that I upload to my S3 bucket. Here is a test function: import boto3 import json s3=boto3.client(‘s3’) def LambdaHandler(event,context): …

Total answers: 2

Saving a json/txt file to S3 from Lambda

Saving a json/txt file to S3 from Lambda Question: I am using lambda to run a program. Once it is run I need to save some data as a json file or txt. I tried to see if there is a way to write a file in lambda and save it but there are no …

Total answers: 1

How to delete file(s) from source s3 bucket after lambda successfully copies file(s) to destination s3 bucket?

How to delete file(s) from source s3 bucket after lambda successfully copies file(s) to destination s3 bucket? Question: I have the following the lambda function which uses an s3 trigger to copy files from a source to a destination bucket. This is working fine. import os import logging import boto3 LOGGER = logging.getLogger() LOGGER.setLevel(logging.INFO) DST_BUCKET …

Total answers: 1

Unable to import module AWS Lambda Function

Unable to import module AWS Lambda Function Question: I’m having issues running basically any lambda function on AWS as the Lambda Function tool would not be able to import the module. I tried to import the packages as layers – pretty wrong I think. (https://www.linkedin.com/pulse/add-external-python-libraries-aws-lambda-using-layers-gabe-olokun/) Then I’ve tried to import the packages as environments (from …

Total answers: 2