I have to read an xml file in the s3 bucket but each day will be a different name as I can read one or more files via lambda using Python.
reading in bucket s3.
Can someone help me.
file bucket s3
s3://pasta1/file1.xml
s3://pasta1/file2.xml
s3://pasta1/file3.xml
how i do to read wth python so no I couldn't ,I wanted to read the three files inside a for .
Eu n?o consigo converter essa linha feita em Python para Lambda usando Boto3:
parser = ET.iterparse(filenames)
error:
OSError: [Errno 36] File name too long: '<?xml version="1.0"
import boto3
from botocore.client import Config
S3_REGION="us-east-1"
bucket="my-bucket"
name="pasta1/file1.xml"
client = boto3.client('s3',region_name=S3_REGION,config=Config(signature_version='s3v4'))
list = client.list_objects_v2(Bucket=bucket,Prefix=name)
print("passo 1")
parser = ET.iterparse(filenames)
for i in list["Contents"]:
if i['Key'] == name: print("achou")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…