CDDB and FreeDB audio CD track info access in Python (original) (raw)
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!
Version History:
- 1.4 (31 Aug 2003): Add Mac OS X and Darwin support. Update FreeDB version to 5 for DYEAR and DGENRE fields.
- 1.3 (10 Mar 2001): Changed default to use FreeDB. Win32 fixes, and compiled to work with Python 2.0. New DiscID.open() cross-platform "do-what-I-mean" call to open the CD audio device opaquely. Allow faking of client identification.
- 1.2 (5 Sep 2000): Patched to work on OpenBSD.
- 1.1 (11 May 2000): Change open() calls to os.open() with O_RDONLY | O_NONBLOCK flags for recent Linux kernels. Fix bug when running DiscID.py from command line.
- 1.0 (19 Apr 2000): Fixes many bugs with multiple match returns from CDDB. Ported cdrom module to FreeBSD, Solaris, and Win32.
- 0.5 (22 Nov 1999): Initial release.
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[1]):
print "Track %.02d: %s" % (i, read_info['TTITLE' + `i`])If you'd like, you can browse the source code, or get CVS access.
Old versions:
- <CDDB-1.3.tar.gz> (browse)
- <CDDB-1.2.tar.gz> (browse)
- <CDDB-1.1.tar.gz> (browse)
- <CDDB-1.0.tar.gz> (browse)
- <CDDB-0.5.tar.gz> (browse)
Last modified: Sun, 31 Aug 2003 16:48:01 -0700