A friend of mine was talking to me recently about how she wished iTunes let her edit song metadata more easily, as if she were editing a spreadsheet in Excel or OpenOffice. Drawing on this as inspiration, I've written a little python script that gets all music files (as specified in the list file_types) from a folder (and all subfolders), exports their metadata to a Comma Separated Value file, and then takes all changes made to that file and applies them to the tracks. As with my xml playlist downloader, you'll need the ID3 library for python installed.
import fnmatch import os import Tkinter import tkFileDialog import ID3 from tkMessageBox import showinfo root = Tkinter.Tk() root.withdraw() folder = tkFileDialog.askdirectory(title="Please select a music directory.") matches =  file_types = ['mp3','aiff'] for root, dirnames, filenames in os.walk(folder): for filename in reduce((lambda x,y: x + y), [fnmatch.filter(filenames, ('*.' + filetype)) for filetype in file_types]): matches.append(os.path.join(root, filename)) output = 'Title,Artist,Album,Track,Year,File Location (Do Not Alter)\n' for song in matches: line = '' id3info = ID3.ID3(song) columns = [id3info.title,id3info.artist,id3info.album,id3info.track,id3info.year,song] for column in columns: line += '"' + str(column) + '",' line = line[:-1] + '\n' output += line filename = tkFileDialog.asksaveasfilename(defaultextension='.csv',filetypes=[('All Files','.*'),('Comma Separated Values File','.csv')]) f = open(filename,'w') f.write(output) f.close() showinfo("File Created","Your CSV file has been created and is ready for you to edit. After you have done so and saved, please click 'OK'.") f = open(filename,'r') f.readline() #Removing column titles for line in f.readlines(): line.replace('"','') columns = line.split(',')#0:title,1:artist,2:album,3:track,4:year,5:location id3info = ID3.ID3(columns) id3info['TITLE'] = columns id3info['ARTIST'] = columns id3info['ALBUM'] = columns id3info['TRACKNUMBER'] = columns id3info['YEAR'] = columns f.close() showinfo("Success","Song metadata has been successfully updated.")Tags: code, csv, metadata, mp3, music, programming, python, tagging, tkinter