
Libdiscid allows one to create musicbrainz discids from audio cds. it reads a cd's table of contents and generates and identifier which can be used to lookup the cd at musicbrainz. python-libdiscid provides a binding to work with libdiscid from python.
this package contains the documentation.