pyid3lib v 0.0.1 Copyright 2000, 2003 Lars Bensmann (lars@almosthappy.de) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. You can download this software from: http://www.almosthappy.de/pyid3lib/ This wrapper is not complete! It just reads the tags, it cannot update or add new ones. Requirements for compilation: - id3lib (http://id3lib.sourceforge.net/) - Python development headers Both should be part of your favourite Linux distribution. I wrote this python wrapper for the libid3 library in 2000. So I'm not really up to date with what I did and why. And this was my first python C++ extension. So it might not even work for you. It wrote it on a Linux box and that's were it is serving me faithfully over the last three years. I just thought that someone else might consider it useful as there still seems to be no ID3v2 compatible Python interface. So at least with this one you can read the tags. The handling is quite simple (well, more or less). It should be similar to the C++ id3lib. There are two simple demonstration programs "id3.py" and "displayid3.py". Actually they are the same program with some lines commented out in displayid3.py. Don't ask me why I did this. I don't remember. Just pass them a mp3-filename and it will print the title. Nice, don't you think so? :-) Anyway, there is another Python program in the archive: "mp32ogg.py". It converts your fine MP3s into Oggs. And actually this is the reason why I didn't implement write support. I didn't need it for this program. So at last, here is a short code snipplet to show you how difficult it is to use the wrapper: -------------------------------------------------------------------------- #/usr/bin/python import libid3 def gettag(tag, tagid): try: return tag.Find(tagid).Field(libid3.FN_TEXT).Get(1024) except AttributeError: return None def showme(file) tag = libid3.Tag() tag.Link(file) artist = gettag(tag, libid3.FID_LEADARTIST) title = gettag(tag, libid3.FID_TITLE) album = gettag(tag, libid3.FID_ALBUM) year = gettag(tag, libid3.FID_YEAR) track = gettag(tag, libid3.FID_TRACKNUM) comment = gettag(tag, libid3.FID_COMMENT) genre = gettag(tag, libid3.FID_CONTENTTYPE) --------------------------------------------------------------------------