metadata#

Metadata related API.

class s3pathlib.core.metadata.MetadataAPIMixin[source]#

A mixin class that implements the metadata related methods.

Note:

  1. only S3 object can have metadata.

  2. metadata is immutable.

  3. user metadata key is always lower case.

head_object(bsm: BotoSesManager | None = None) dict[source]#

Call head_object() api, store metadata value.

etag[source]#

For small file, it is the md5 check sum. For large file, because it is created from multi part upload, it is the sum of md5 for each part and md5 of the sum.

Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html

New in version 1.0.1.

last_modified_at[source]#

Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html

New in version 1.0.1.

size[source]#

Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html

New in version 1.0.1.

property size_for_human: str#

A human-readable string version of the size.

New in version 1.0.1.

version_id[source]#

Only available if you turned on versioning for the bucket.

Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html

New in version 1.0.1.

Changed in version 2.0.1: return ‘null’ if it is not a version enabled bucket

expire_at[source]#

Only available if you turned on TTL.

Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html

New in version 1.0.1.

property metadata: dict#

Access the metadata of the object.

Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html

New in version 1.0.1.

clear_cache() None[source]#

Clear all cache that stores metadata information.

New in version 1.0.1.