This is actually a set of three modules to access the CDDB and FreeDB online databases of audio CD track titles and information. It includes a C extension module to fetch track lengths under Linux, FreeBSD, OpenBSD, Mac OS X, Solaris, and Win32, which is easily ported to other operating systems.
This module is hosted on SourceForge. Be sure to visit the CDDB.py page there!
Fetch the source (current version 1.4)
Here is a simple example of using the CDDB module. See the README file for extensive documentation. This example prints out the track titles on a CD.
import CDDB, DiscID cdrom = DiscID.open() disc_id = DiscID.disc_id(cdrom) (query_status, query_info) = CDDB.query(disc_id) (read_status, read_info) = CDDB.read(query_info['category'], query_info['disc_id']) for i in range(disc_id): print "Track %.02d: %s" % (i, read_info['TTITLE' + `i`])
If you'd like, you can browse the source code, or get CVS access.