boto3: Best way to delete object in S3

0

There are several ways to delete single object in s3 bucket using boto3 in Python.

S3.Client.delete_object(), S3.Bucket.delete_objects(), S3.Object.delete(), ...

I don't know how to choose the best way for our code.

Would you please give me information about what features each class has, what is the point in choosing an appropriate method?

Thank you.

질문됨 일 년 전3231회 조회
1개 답변
0
수락된 답변

You should use S3.Client from now on. The AWS Python SDK team does not intend to add new features to the resources interface in boto3. S3.Bucket and S3.Object implement the resources interface.

Would you check the first note in the following document. https://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html

imiky
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠