music tag python code example
Example: Reading music tags python
import music_tag
f = music_tag.load_file("music-tag/sample/440Hz.m4a")
# dict access returns a MetadataItem
title_item = f['title']
# MetadataItems keep track of multi-valued keys
title_item.values # -> ['440Hz']
# A single value can be extracted
title_item.first # -> '440Hz'
title_item.value # -> '440Hz'
# MetadataItems can also be cast to a string
str(title_item) # -> '440Hz'