metadata¶
Metadata related API.
- class s3pathlib.core.metadata.MetadataAPIMixin[source]¶
A mixin class that implements the metadata related methods.
Note:
only S3 object can have metadata.
metadata is immutable.
user metadata key is always lower case.
- head_object(bsm: BotoSesManager | S3Client | None = None) dict[source]¶
Call head_object() api, store metadata value.
- property response: HeadObjectOutputTypeDef | PutObjectOutputTypeDef¶
The response dictionary from the S3 API, returned by the following
boto3.client("s3")methods:head_object: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/head_object.html
put_object: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/put_object.html
It’s particularly useful when you need to access specific response data after you called
S3Path.head_object(...),S3Path.write_bytes(...)orS3Path.write_text(...)method.Added in version 2.2.1.
- 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
Added in version 1.0.1.
- last_modified_at[source]¶
Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html
Added in version 1.0.1.
- size[source]¶
Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Object.html
Added 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
Added 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
Added 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
Added in version 1.0.1.