Skip to content

S3Client

Index > S3 > S3Client

Auto-generated documentation for S3 type annotations stubs module mypy-boto3-s3.

S3Client

Type annotations and code completion for boto3.client("s3"). boto3 documentation

Usage example
from boto3.session import Session
from mypy_boto3_s3.client import S3Client

def get_s3_client() -> S3Client:
    return Session().client("s3")

Exceptions

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("s3").exceptions structure.

Usage example
client = boto3.client("s3")

try:
    do_something(client)
except (
    client.BucketAlreadyExists,
    client.BucketAlreadyOwnedByYou,
    client.ClientError,
    client.InvalidObjectState,
    client.NoSuchBucket,
    client.NoSuchKey,
    client.NoSuchUpload,
    client.ObjectAlreadyInActiveTierError,
    client.ObjectNotInActiveTierError,
) as e:
    print(e)
Type checking example
from mypy_boto3_s3.client import Exceptions

def handle_error(exc: Exceptions.BucketAlreadyExists) -> None:
    ...

Methods

abort_multipart_upload

This action aborts a multipart upload.

Type annotations and code completion for boto3.client("s3").abort_multipart_upload method. boto3 documentation

Method definition
def abort_multipart_upload(
    self,
    *,
    Bucket: str,
    Key: str,
    UploadId: str,
    RequestPayer: RequestPayerType = ...,  # (1)
    ExpectedBucketOwner: str = ...,
) -> AbortMultipartUploadOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See AbortMultipartUploadOutputTypeDef
Usage example with kwargs
kwargs: AbortMultipartUploadRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Key": ...,
    "UploadId": ...,
}

parent.abort_multipart_upload(**kwargs)
  1. See AbortMultipartUploadRequestRequestTypeDef

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("s3").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("s3").close method. boto3 documentation

Method definition
def close(
    self,
) -> None:
    ...

complete_multipart_upload

Completes a multipart upload by assembling previously uploaded parts.

Type annotations and code completion for boto3.client("s3").complete_multipart_upload method. boto3 documentation

Method definition
def complete_multipart_upload(
    self,
    *,
    Bucket: str,
    Key: str,
    UploadId: str,
    MultipartUpload: CompletedMultipartUploadTypeDef = ...,  # (1)
    ChecksumCRC32: str = ...,
    ChecksumCRC32C: str = ...,
    ChecksumSHA1: str = ...,
    ChecksumSHA256: str = ...,
    RequestPayer: RequestPayerType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
) -> CompleteMultipartUploadOutputTypeDef:  # (3)
    ...
  1. See CompletedMultipartUploadTypeDef
  2. See RequestPayerType
  3. See CompleteMultipartUploadOutputTypeDef
Usage example with kwargs
kwargs: CompleteMultipartUploadRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Key": ...,
    "UploadId": ...,
}

parent.complete_multipart_upload(**kwargs)
  1. See CompleteMultipartUploadRequestRequestTypeDef

copy

Copy an object from one S3 location to another.

Type annotations and code completion for boto3.client("s3").copy method. boto3 documentation

Method definition
def copy(
    self,
    CopySource: CopySourceTypeDef,  # (1)
    Bucket: str,
    Key: str,
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    SourceClient: BaseClient = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
  1. See CopySourceTypeDef
Usage example with kwargs
kwargs: ClientCopyRequestTypeDef = {  # (1)
    "CopySource": ...,
    "Bucket": ...,
    "Key": ...,
}

parent.copy(**kwargs)
  1. See ClientCopyRequestTypeDef

copy_object

Creates a copy of an object that is already stored in Amazon S3.

Type annotations and code completion for boto3.client("s3").copy_object method. boto3 documentation

Method definition
def copy_object(
    self,
    *,
    Bucket: str,
    CopySource: Union[str, CopySourceTypeDef],  # (1)
    Key: str,
    ACL: ObjectCannedACLType = ...,  # (2)
    CacheControl: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (3)
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentType: str = ...,
    CopySourceIfMatch: str = ...,
    CopySourceIfModifiedSince: Union[datetime, str] = ...,
    CopySourceIfNoneMatch: str = ...,
    CopySourceIfUnmodifiedSince: Union[datetime, str] = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    MetadataDirective: MetadataDirectiveType = ...,  # (4)
    TaggingDirective: TaggingDirectiveType = ...,  # (5)
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (6)
    StorageClass: StorageClassType = ...,  # (7)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    CopySourceSSECustomerAlgorithm: str = ...,
    CopySourceSSECustomerKey: str = ...,
    CopySourceSSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (8)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (9)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (10)
    ExpectedBucketOwner: str = ...,
    ExpectedSourceBucketOwner: str = ...,
) -> CopyObjectOutputTypeDef:  # (11)
    ...
  1. See CopySourceTypeDef
  2. See ObjectCannedACLType
  3. See ChecksumAlgorithmType
  4. See MetadataDirectiveType
  5. See TaggingDirectiveType
  6. See ServerSideEncryptionType
  7. See StorageClassType
  8. See RequestPayerType
  9. See ObjectLockModeType
  10. See ObjectLockLegalHoldStatusType
  11. See CopyObjectOutputTypeDef
Usage example with kwargs
kwargs: CopyObjectRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "CopySource": ...,
    "Key": ...,
}

parent.copy_object(**kwargs)
  1. See CopyObjectRequestRequestTypeDef

create_bucket

Creates a new S3 bucket.

Type annotations and code completion for boto3.client("s3").create_bucket method. boto3 documentation

Method definition
def create_bucket(
    self,
    *,
    Bucket: str,
    ACL: BucketCannedACLType = ...,  # (1)
    CreateBucketConfiguration: CreateBucketConfigurationTypeDef = ...,  # (2)
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWrite: str = ...,
    GrantWriteACP: str = ...,
    ObjectLockEnabledForBucket: bool = ...,
    ObjectOwnership: ObjectOwnershipType = ...,  # (3)
) -> CreateBucketOutputTypeDef:  # (4)
    ...
  1. See BucketCannedACLType
  2. See CreateBucketConfigurationTypeDef
  3. See ObjectOwnershipType
  4. See CreateBucketOutputTypeDef
Usage example with kwargs
kwargs: CreateBucketRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.create_bucket(**kwargs)
  1. See CreateBucketRequestRequestTypeDef

create_multipart_upload

This action initiates a multipart upload and returns an upload ID.

Type annotations and code completion for boto3.client("s3").create_multipart_upload method. boto3 documentation

Method definition
def create_multipart_upload(
    self,
    *,
    Bucket: str,
    Key: str,
    ACL: ObjectCannedACLType = ...,  # (1)
    CacheControl: str = ...,
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentType: str = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (2)
    StorageClass: StorageClassType = ...,  # (3)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    RequestPayer: RequestPayerType = ...,  # (4)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (5)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (6)
    ExpectedBucketOwner: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (7)
) -> CreateMultipartUploadOutputTypeDef:  # (8)
    ...
  1. See ObjectCannedACLType
  2. See ServerSideEncryptionType
  3. See StorageClassType
  4. See RequestPayerType
  5. See ObjectLockModeType
  6. See ObjectLockLegalHoldStatusType
  7. See ChecksumAlgorithmType
  8. See CreateMultipartUploadOutputTypeDef
Usage example with kwargs
kwargs: CreateMultipartUploadRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Key": ...,
}

parent.create_multipart_upload(**kwargs)
  1. See CreateMultipartUploadRequestRequestTypeDef

delete_bucket

Deletes the S3 bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket method. boto3 documentation

Method definition
def delete_bucket(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket(**kwargs)
  1. See DeleteBucketRequestRequestTypeDef

delete_bucket_analytics_configuration

Deletes an analytics configuration for the bucket (specified by the analytics configuration ID).

Type annotations and code completion for boto3.client("s3").delete_bucket_analytics_configuration method. boto3 documentation

Method definition
def delete_bucket_analytics_configuration(
    self,
    *,
    Bucket: str,
    Id: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketAnalyticsConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Id": ...,
}

parent.delete_bucket_analytics_configuration(**kwargs)
  1. See DeleteBucketAnalyticsConfigurationRequestRequestTypeDef

delete_bucket_cors

Deletes the cors configuration information set for the bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_cors method. boto3 documentation

Method definition
def delete_bucket_cors(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketCorsRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket_cors(**kwargs)
  1. See DeleteBucketCorsRequestRequestTypeDef

delete_bucket_encryption

This implementation of the DELETE action removes default encryption from the bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_encryption method. boto3 documentation

Method definition
def delete_bucket_encryption(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketEncryptionRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket_encryption(**kwargs)
  1. See DeleteBucketEncryptionRequestRequestTypeDef

delete_bucket_intelligent_tiering_configuration

Deletes the S3 Intelligent-Tiering configuration from the specified bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_intelligent_tiering_configuration method. boto3 documentation

Method definition
def delete_bucket_intelligent_tiering_configuration(
    self,
    *,
    Bucket: str,
    Id: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketIntelligentTieringConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Id": ...,
}

parent.delete_bucket_intelligent_tiering_configuration(**kwargs)
  1. See DeleteBucketIntelligentTieringConfigurationRequestRequestTypeDef

delete_bucket_inventory_configuration

Deletes an inventory configuration (identified by the inventory ID) from the bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_inventory_configuration method. boto3 documentation

Method definition
def delete_bucket_inventory_configuration(
    self,
    *,
    Bucket: str,
    Id: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketInventoryConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Id": ...,
}

parent.delete_bucket_inventory_configuration(**kwargs)
  1. See DeleteBucketInventoryConfigurationRequestRequestTypeDef

delete_bucket_lifecycle

Deletes the lifecycle configuration from the specified bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_lifecycle method. boto3 documentation

Method definition
def delete_bucket_lifecycle(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketLifecycleRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket_lifecycle(**kwargs)
  1. See DeleteBucketLifecycleRequestRequestTypeDef

delete_bucket_metrics_configuration

Deletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics configuration ID) from the bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_metrics_configuration method. boto3 documentation

Method definition
def delete_bucket_metrics_configuration(
    self,
    *,
    Bucket: str,
    Id: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketMetricsConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Id": ...,
}

parent.delete_bucket_metrics_configuration(**kwargs)
  1. See DeleteBucketMetricsConfigurationRequestRequestTypeDef

delete_bucket_ownership_controls

Removes OwnershipControls for an Amazon S3 bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_ownership_controls method. boto3 documentation

Method definition
def delete_bucket_ownership_controls(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketOwnershipControlsRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket_ownership_controls(**kwargs)
  1. See DeleteBucketOwnershipControlsRequestRequestTypeDef

delete_bucket_policy

This implementation of the DELETE action uses the policy subresource to delete the policy of a specified bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_policy method. boto3 documentation

Method definition
def delete_bucket_policy(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketPolicyRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket_policy(**kwargs)
  1. See DeleteBucketPolicyRequestRequestTypeDef

delete_bucket_replication

Deletes the replication configuration from the bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_replication method. boto3 documentation

Method definition
def delete_bucket_replication(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketReplicationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket_replication(**kwargs)
  1. See DeleteBucketReplicationRequestRequestTypeDef

delete_bucket_tagging

Deletes the tags from the bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_tagging method. boto3 documentation

Method definition
def delete_bucket_tagging(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketTaggingRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket_tagging(**kwargs)
  1. See DeleteBucketTaggingRequestRequestTypeDef

delete_bucket_website

This action removes the website configuration for a bucket.

Type annotations and code completion for boto3.client("s3").delete_bucket_website method. boto3 documentation

Method definition
def delete_bucket_website(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteBucketWebsiteRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_bucket_website(**kwargs)
  1. See DeleteBucketWebsiteRequestRequestTypeDef

delete_object

Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.

Type annotations and code completion for boto3.client("s3").delete_object method. boto3 documentation

Method definition
def delete_object(
    self,
    *,
    Bucket: str,
    Key: str,
    MFA: str = ...,
    VersionId: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See DeleteObjectOutputTypeDef
Usage example with kwargs
kwargs: DeleteObjectRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Key": ...,
}

parent.delete_object(**kwargs)
  1. See DeleteObjectRequestRequestTypeDef

delete_object_tagging

Removes the entire tag set from the specified object.

Type annotations and code completion for boto3.client("s3").delete_object_tagging method. boto3 documentation

Method definition
def delete_object_tagging(
    self,
    *,
    Bucket: str,
    Key: str,
    VersionId: str = ...,
    ExpectedBucketOwner: str = ...,
) -> DeleteObjectTaggingOutputTypeDef:  # (1)
    ...
  1. See DeleteObjectTaggingOutputTypeDef
Usage example with kwargs
kwargs: DeleteObjectTaggingRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Key": ...,
}

parent.delete_object_tagging(**kwargs)
  1. See DeleteObjectTaggingRequestRequestTypeDef

delete_objects

This action enables you to delete multiple objects from a bucket using a single HTTP request.

Type annotations and code completion for boto3.client("s3").delete_objects method. boto3 documentation

Method definition
def delete_objects(
    self,
    *,
    Bucket: str,
    Delete: DeleteTypeDef,  # (1)
    MFA: str = ...,
    RequestPayer: RequestPayerType = ...,  # (2)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (3)
) -> DeleteObjectsOutputTypeDef:  # (4)
    ...
  1. See DeleteTypeDef
  2. See RequestPayerType
  3. See ChecksumAlgorithmType
  4. See DeleteObjectsOutputTypeDef
Usage example with kwargs
kwargs: DeleteObjectsRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Delete": ...,
}

parent.delete_objects(**kwargs)
  1. See DeleteObjectsRequestRequestTypeDef

delete_public_access_block

Removes the PublicAccessBlock configuration for an Amazon S3 bucket.

Type annotations and code completion for boto3.client("s3").delete_public_access_block method. boto3 documentation

Method definition
def delete_public_access_block(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeletePublicAccessBlockRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.delete_public_access_block(**kwargs)
  1. See DeletePublicAccessBlockRequestRequestTypeDef

download_file

Download an S3 object to a file.

Type annotations and code completion for boto3.client("s3").download_file method. boto3 documentation

Method definition
def download_file(
    self,
    Bucket: str,
    Key: str,
    Filename: str,
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: ClientDownloadFileRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Key": ...,
    "Filename": ...,
}

parent.download_file(**kwargs)
  1. See ClientDownloadFileRequestTypeDef

download_fileobj

Download an object from S3 to a file-like object.

Type annotations and code completion for boto3.client("s3").download_fileobj method. boto3 documentation

Method definition
def download_fileobj(
    self,
    Bucket: str,
    Key: str,
    Fileobj: Union[IO[Any], StreamingBody],
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: ClientDownloadFileobjRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Key": ...,
    "Fileobj": ...,
}

parent.download_fileobj(**kwargs)
  1. See ClientDownloadFileobjRequestTypeDef

generate_presigned_post

Builds the url and the form fields used for a presigned s3 post.

Type annotations and code completion for boto3.client("s3").generate_presigned_post method. boto3 documentation

Method definition
def generate_presigned_post(
    self,
    Bucket: str,
    Key: str,
    Fields: Dict[str, Any] = ...,
    Conditions: List[Any] = ...,
    ExpiresIn: int = 3600,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: ClientGeneratePresignedPostRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Key": ...,
}

parent.generate_presigned_post(**kwargs)
  1. See ClientGeneratePresignedPostRequestTypeDef

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for boto3.client("s3").generate_presigned_url method. boto3 documentation

Method definition
def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_bucket_accelerate_configuration

This implementation of the GET action uses the accelerate subresource to return the Transfer Acceleration state of a bucket, which is either Enabled or Suspended.

Type annotations and code completion for boto3.client("s3").get_bucket_accelerate_configuration method. boto3 documentation

Method definition
def get_bucket_accelerate_configuration(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketAccelerateConfigurationOutputTypeDef:  # (1)
    ...
  1. See GetBucketAccelerateConfigurationOutputTypeDef
Usage example with kwargs
kwargs: GetBucketAccelerateConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_accelerate_configuration(**kwargs)
  1. See GetBucketAccelerateConfigurationRequestRequestTypeDef

get_bucket_acl

This implementation of the GET action uses the acl subresource to return the access control list (ACL) of a bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_acl method. boto3 documentation

Method definition
def get_bucket_acl(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketAclOutputTypeDef:  # (1)
    ...
  1. See GetBucketAclOutputTypeDef
Usage example with kwargs
kwargs: GetBucketAclRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_acl(**kwargs)
  1. See GetBucketAclRequestRequestTypeDef

get_bucket_analytics_configuration

This implementation of the GET action returns an analytics configuration (identified by the analytics configuration ID) from the bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_analytics_configuration method. boto3 documentation

Method definition
def get_bucket_analytics_configuration(
    self,
    *,
    Bucket: str,
    Id: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketAnalyticsConfigurationOutputTypeDef:  # (1)
    ...
  1. See GetBucketAnalyticsConfigurationOutputTypeDef
Usage example with kwargs
kwargs: GetBucketAnalyticsConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Id": ...,
}

parent.get_bucket_analytics_configuration(**kwargs)
  1. See GetBucketAnalyticsConfigurationRequestRequestTypeDef

get_bucket_cors

Returns the Cross-Origin Resource Sharing (CORS) configuration information set for the bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_cors method. boto3 documentation

Method definition
def get_bucket_cors(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketCorsOutputTypeDef:  # (1)
    ...
  1. See GetBucketCorsOutputTypeDef
Usage example with kwargs
kwargs: GetBucketCorsRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_cors(**kwargs)
  1. See GetBucketCorsRequestRequestTypeDef

get_bucket_encryption

Returns the default encryption configuration for an Amazon S3 bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_encryption method. boto3 documentation

Method definition
def get_bucket_encryption(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketEncryptionOutputTypeDef:  # (1)
    ...
  1. See GetBucketEncryptionOutputTypeDef
Usage example with kwargs
kwargs: GetBucketEncryptionRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_encryption(**kwargs)
  1. See GetBucketEncryptionRequestRequestTypeDef

get_bucket_intelligent_tiering_configuration

Gets the S3 Intelligent-Tiering configuration from the specified bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_intelligent_tiering_configuration method. boto3 documentation

Method definition
def get_bucket_intelligent_tiering_configuration(
    self,
    *,
    Bucket: str,
    Id: str,
) -> GetBucketIntelligentTieringConfigurationOutputTypeDef:  # (1)
    ...
  1. See GetBucketIntelligentTieringConfigurationOutputTypeDef
Usage example with kwargs
kwargs: GetBucketIntelligentTieringConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Id": ...,
}

parent.get_bucket_intelligent_tiering_configuration(**kwargs)
  1. See GetBucketIntelligentTieringConfigurationRequestRequestTypeDef

get_bucket_inventory_configuration

Returns an inventory configuration (identified by the inventory configuration ID) from the bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_inventory_configuration method. boto3 documentation

Method definition
def get_bucket_inventory_configuration(
    self,
    *,
    Bucket: str,
    Id: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketInventoryConfigurationOutputTypeDef:  # (1)
    ...
  1. See GetBucketInventoryConfigurationOutputTypeDef
Usage example with kwargs
kwargs: GetBucketInventoryConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Id": ...,
}

parent.get_bucket_inventory_configuration(**kwargs)
  1. See GetBucketInventoryConfigurationRequestRequestTypeDef

get_bucket_lifecycle

.

Type annotations and code completion for boto3.client("s3").get_bucket_lifecycle method. boto3 documentation

Method definition
def get_bucket_lifecycle(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketLifecycleOutputTypeDef:  # (1)
    ...
  1. See GetBucketLifecycleOutputTypeDef
Usage example with kwargs
kwargs: GetBucketLifecycleRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_lifecycle(**kwargs)
  1. See GetBucketLifecycleRequestRequestTypeDef

get_bucket_lifecycle_configuration

.

Type annotations and code completion for boto3.client("s3").get_bucket_lifecycle_configuration method. boto3 documentation

Method definition
def get_bucket_lifecycle_configuration(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketLifecycleConfigurationOutputTypeDef:  # (1)
    ...
  1. See GetBucketLifecycleConfigurationOutputTypeDef
Usage example with kwargs
kwargs: GetBucketLifecycleConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_lifecycle_configuration(**kwargs)
  1. See GetBucketLifecycleConfigurationRequestRequestTypeDef

get_bucket_location

Returns the Region the bucket resides in.

Type annotations and code completion for boto3.client("s3").get_bucket_location method. boto3 documentation

Method definition
def get_bucket_location(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketLocationOutputTypeDef:  # (1)
    ...
  1. See GetBucketLocationOutputTypeDef
Usage example with kwargs
kwargs: GetBucketLocationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_location(**kwargs)
  1. See GetBucketLocationRequestRequestTypeDef

get_bucket_logging

Returns the logging status of a bucket and the permissions users have to view and modify that status.

Type annotations and code completion for boto3.client("s3").get_bucket_logging method. boto3 documentation

Method definition
def get_bucket_logging(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketLoggingOutputTypeDef:  # (1)
    ...
  1. See GetBucketLoggingOutputTypeDef
Usage example with kwargs
kwargs: GetBucketLoggingRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_logging(**kwargs)
  1. See GetBucketLoggingRequestRequestTypeDef

get_bucket_metrics_configuration

Gets a metrics configuration (specified by the metrics configuration ID) from the bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_metrics_configuration method. boto3 documentation

Method definition
def get_bucket_metrics_configuration(
    self,
    *,
    Bucket: str,
    Id: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketMetricsConfigurationOutputTypeDef:  # (1)
    ...
  1. See GetBucketMetricsConfigurationOutputTypeDef
Usage example with kwargs
kwargs: GetBucketMetricsConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
    "Id": ...,
}

parent.get_bucket_metrics_configuration(**kwargs)
  1. See GetBucketMetricsConfigurationRequestRequestTypeDef

get_bucket_notification

No longer used, see GetBucketNotificationConfiguration_ .

Type annotations and code completion for boto3.client("s3").get_bucket_notification method. boto3 documentation

Method definition
def get_bucket_notification(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> NotificationConfigurationDeprecatedResponseMetadataTypeDef:  # (1)
    ...
  1. See NotificationConfigurationDeprecatedResponseMetadataTypeDef
Usage example with kwargs
kwargs: GetBucketNotificationConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_notification(**kwargs)
  1. See GetBucketNotificationConfigurationRequestRequestTypeDef

get_bucket_notification_configuration

Returns the notification configuration of a bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_notification_configuration method. boto3 documentation

Method definition
def get_bucket_notification_configuration(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> NotificationConfigurationResponseMetadataTypeDef:  # (1)
    ...
  1. See NotificationConfigurationResponseMetadataTypeDef
Usage example with kwargs
kwargs: GetBucketNotificationConfigurationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_notification_configuration(**kwargs)
  1. See GetBucketNotificationConfigurationRequestRequestTypeDef

get_bucket_ownership_controls

Retrieves OwnershipControls for an Amazon S3 bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_ownership_controls method. boto3 documentation

Method definition
def get_bucket_ownership_controls(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketOwnershipControlsOutputTypeDef:  # (1)
    ...
  1. See GetBucketOwnershipControlsOutputTypeDef
Usage example with kwargs
kwargs: GetBucketOwnershipControlsRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_ownership_controls(**kwargs)
  1. See GetBucketOwnershipControlsRequestRequestTypeDef

get_bucket_policy

Returns the policy of a specified bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_policy method. boto3 documentation

Method definition
def get_bucket_policy(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketPolicyOutputTypeDef:  # (1)
    ...
  1. See GetBucketPolicyOutputTypeDef
Usage example with kwargs
kwargs: GetBucketPolicyRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_policy(**kwargs)
  1. See GetBucketPolicyRequestRequestTypeDef

get_bucket_policy_status

Retrieves the policy status for an Amazon S3 bucket, indicating whether the bucket is public.

Type annotations and code completion for boto3.client("s3").get_bucket_policy_status method. boto3 documentation

Method definition
def get_bucket_policy_status(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketPolicyStatusOutputTypeDef:  # (1)
    ...
  1. See GetBucketPolicyStatusOutputTypeDef
Usage example with kwargs
kwargs: GetBucketPolicyStatusRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_policy_status(**kwargs)
  1. See GetBucketPolicyStatusRequestRequestTypeDef

get_bucket_replication

Returns the replication configuration of a bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_replication method. boto3 documentation

Method definition
def get_bucket_replication(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketReplicationOutputTypeDef:  # (1)
    ...
  1. See GetBucketReplicationOutputTypeDef
Usage example with kwargs
kwargs: GetBucketReplicationRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_replication(**kwargs)
  1. See GetBucketReplicationRequestRequestTypeDef

get_bucket_request_payment

Returns the request payment configuration of a bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_request_payment method. boto3 documentation

Method definition
def get_bucket_request_payment(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketRequestPaymentOutputTypeDef:  # (1)
    ...
  1. See GetBucketRequestPaymentOutputTypeDef
Usage example with kwargs
kwargs: GetBucketRequestPaymentRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_request_payment(**kwargs)
  1. See GetBucketRequestPaymentRequestRequestTypeDef

get_bucket_tagging

Returns the tag set associated with the bucket.

Type annotations and code completion for boto3.client("s3").get_bucket_tagging method. boto3 documentation

Method definition
def get_bucket_tagging(
    self,
    *,
    Bucket: str,
    ExpectedBucketOwner: str = ...,
) -> GetBucketTaggingOutputTypeDef:  # (1)
    ...
  1. See GetBucketTaggingOutputTypeDef
Usage example with kwargs
kwargs: GetBucketTaggingRequestRequestTypeDef = {  # (1)
    "Bucket": ...,
}

parent.get_bucket_tagging(**