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.
get_bucket_tagging: it’s a tag set.
get_object_tagging: it’s a tag set.
- 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&..."