Here’s a nice and short Python script that some of you might find quite handy, especially if you have a huge collection of music files (MP3s): an ID3 metadata tagger. To use, all it requires is the ID3 lib and for the script to be placed in the same directory together with the MP3 files.
import os, sys from ID3 import * files = os.listdir(os.getcwd()) for f in files: x = os.path.splitext(f) if x[1] == '.mp3': n = x[0].split(' - ') author = n[0] title = n[1] id3info = ID3(f) id3info['ARTIST'] = author id3info['TITLE'] = title print f+' id3 tagged.' print 'Done!'