bucket

Bucket related API.

class s3pathlib.core.bucket.BucketAPIMixin[source]

A mixin class that implements the bucket related methods.

classmethod from_bucket(bucket: str) S3Path[source]

Create an S3Path object from a bucket name.

create_bucket(region: str = 'us-east-1', acl: str = OPT, grant_full_control: str = OPT, grant_read: str = OPT, grant_read_acp: str = OPT, grant_write: str = OPT, grant_write_acp: str = OPT, object_lock_enabled_for_bucket: bool = OPT, object_ownership: str = OPT, bsm: BotoSesManager | S3Client | None = None) dict[source]

Create an S3 bucket.

delete_bucket(expected_bucket_owner: str = OPT, bsm: BotoSesManager | S3Client | None = None)[source]

Delete an S3 bucket.

get_bucket_versioning(expected_bucket_owner: str = OPT, bsm: BotoSesManager | S3Client | None = None) dict[source]

Get the versioning state of an S3 bucket.

is_versioning_enabled(bsm: BotoSesManager | S3Client | None = None) bool[source]

Check if the versioning of an S3 bucket is enabled.

is_versioning_suspended(bsm: BotoSesManager | S3Client | None = None) bool[source]

Check if the versioning of an S3 bucket is suspended.

put_bucket_versioning(enable_versioning: bool, enable_mfa_delete: bool = OPT, check_sum_algorithm: str = OPT, mfa: str = OPT, expected_bucket_owner: str = OPT, bsm: BotoSesManager | S3Client | None = None) dict[source]

Enable or suspend S3 bucket versioning.

classmethod list_buckets(bsm: BotoSesManager | S3Client | None = None) List[S3Path][source]

List all S3 buckets.