naturtag.metadata.keyword_metadata module#

class naturtag.metadata.keyword_metadata.KeywordMetadata(metadata=None, keywords=None)#

Bases: object

Container for combining, parsing, and organizing keyword metadata into relevant categories

property flickr_tags#

Get all taxonomy and normal keywords as quoted, space-separated tags compatible with Flickr

property hier_keyword_tree: dict[str, Any]#

Get all hierarchical keywords as a nested dict

Return type

dict[str, Any]

property hier_keyword_tree_str: str#

Get all hierarchical keywords as a single string, in indented tree format

Return type

str

property kv_keyword_list: list[str]#

Join key-value pairs back into strings

Return type

list[str]

property tags: dict[str, Any]#

Add all keywords to all appropriate XMP, EXIF, and IPTC tags

Returns

Mapping from qualified tag name to tag value(s)

Return type

dict

naturtag.metadata.keyword_metadata.sort_taxonomy_keywords(keywords)#

Sort keywords by taxonomic rank, where applicable

Return type

list[str]