Tagging ID3 Metadata With Python

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!'

Incoming search terms for the article:

Related Posts

Turn A Photo Into A Vector Portrait With Photoshop

Correctly Embed Watermarks In Portrait And Landscape Photos Using Conditional Actions In Photoshop CS6.1

Oregon-Inspired Photoshop Tutorial

Create Google Play’s Tab Navigation Using jQuery And CSS