← Go Back

How to Read or Edit Metadata of an MP3 File

Using the eyeD3 library. For example, to read the metadata of file.mp3:

import eyed3

mp3 = eyed3.load("file.mp3")
print("Artist:", mp3.tag.artist)
print("Album:", mp3.tag.album)
print("Album artist:", mp3.tag.album_artist)
print("Title:", mp3.tag.title)
print("Track number:", mp3.tag.track_num)

It is also possible to modify the metadata, for example:

import eyed3

mp3 = eyed3.load("file.mp3")
# Modify the metadata.
mp3.tag.artist = "New artist"
mp3.tag.title = "New title"
# Save changes.
mp3.tag.save()

The eyeD3 module must be installed by running:

pip install eyed3


eyed3 mp3