The Python TagLib Bindings (aka python-taglib-bindings, or p-t-b) is a set
of bindings for Python, generated using SIP, for TagLib a library for
reading and manipulating audio file (ogg,mp3,etc) tags.
I wrote this set of bindings with two goals in mind. 1) To learn how to
write bindings with SIP and 2) to get taglib support in python on a system
where I couldn't build the python taglib package from the namingmuse team.
Of course, they deserve all the kudos in the world for having stable bindings
that are well tested. Mine are not. They might eat your dog or cause your
house to collapse. This is very alpha stuff.
The software comes in two components, the sip c++ to python bridge, and a
pure python module that provides a pythonic class attribute style api.
Neither of which are documented yet :-).
Example
>>> import taglib # python style API
>>> tags = taglib.TagFile( '/path/to/my.mp3' )
>>> tags.artist
'Joe Somebody'
>>> tags.title
'My Rainy Day'
>>> tags.bitrate
192
>>> tags.artist = 'Joe Somebody and The Beatniks'
>>> tags.save() # changes won't be saved to the file unless save() is called
Or, using the C++ API directly
>>> import _taglib
>>> ref = _taglib.FileRef( '/path/to/my.mp3' )
>>> ref.tag().artist()
'Joe Somebody and The Beatniks'
>>> ref.tag().title()
'My Rainy Day'
>>> ref.audioProperties().bitrate()
192
Install
Aquire SIP version 4 (on debain install sip4,python-sip4,python-sip4-dev)
Download python-taglib-bindings
$ python setup.py build
# python setup.py install