Accessing iTunes XML metadata with Python
Tutorial – iTunes XML
Read and manipulate data from your iTunes XML in order to share music metadata between applications and across devices.
The Extensible Markup Language (XML)[1] is a widely used markup language and text file format for storing and exchanging arbitrary data. A wide variety of applications, including the Apple iTunes application, use the XML format for exchanging or storing library data. In this article, I will show you how to use Python to read and manipulate data from an iTunes [2] XML library file.
iTunes Library File
iTunes divides its content into two separate categories: media and metadata. Media (music and video) are saved in separate files from metadata. Throughout the rest of this article, I will focus on music information – artist, song title, album title, track number, genre, release year – and refer to it as metadata. The iTunes metadata files have either a .itl
or .xml
extension (Figure 1).

[...]
Buy this article as PDF
(incl. VAT)