tag#

This module provides AWS Tags manipulation helpers.

s3pathlib.tag.parse_tags(data: List[Dict[str, str]]) Dict[str, str][source]#

Convert the tag set in boto3 API response into pythonic dictionary key value pairs.

Parameters:

data – the tag set in boto3 API response.

Returns:

the pythonic dictionary key value pairs.

s3pathlib.tag.encode_tag_set(tags: Dict[str, str]) List[Dict[str, str]][source]#

Some API requires: [{"Key": "name", "Value": "Alice"}, {...}, ...] for tagging parameter.

Example:

>>> encode_tag_set({"name": "Alice", ...})
[{"Key": "name", "Value": "Alice"}, ...]
s3pathlib.tag.encode_url_query(tags: Dict[str, str]) str[source]#

Some API requires: Key1=Value1&Key2=Value2 for tagging parameter.

Example:

>>> encode_url_query({"name": "Alice", ...})
"name=Alice&..."
s3pathlib.tag.encode_for_put_object(tags: Dict[str, str]) str[source]#

Encode tags for put_object.

s3pathlib.tag.encode_for_put_bucket_tagging(tags: Dict[str, str]) List[Dict[str, str]][source]#

Encode tags for put_bucket_tagging.

s3pathlib.tag.encode_for_put_object_tagging(tags: Dict[str, str]) List[Dict[str, str]][source]#

Encode tags for put_object_tagging.