Birch Street Computing -

about me

John M is a Linux fan in Lowell, MA.

I work at at a local company writing software. I fool around with Free and Open Source software for fun.

I am an avid user.

Python TagLib Bindings with SIP

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 :-).


>>> import taglib # python style API
>>> tags = taglib.TagFile( '/path/to/my.mp3' )
>>> tags.artist
'Joe Somebody'
>>> tags.title
'My Rainy Day'
>>> tags.bitrate
>>> tags.artist = 'Joe Somebody and The Beatniks'
>>> # 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()


  1. Aquire SIP version 4 (on debain install sip4,python-sip4,python-sip4-dev)

  2. Download python-taglib-bindings

  3. $ python build

  4. # python install


Current Version
Python 2.3+
SIP Bindings Generator (v4)
Taglib Bindings (0.1)
Type hg clone at the command prompt to get a copy of the development source code.
Source Code Web View

Every blog page or article on this site is available under the CC-BY-SA license unless otherwise noted.