Skip to content
This repository has been archived by the owner on Jan 3, 2020. It is now read-only.
/ pYtunes Public archive

🎵 Read iTunes library file

License

Notifications You must be signed in to change notification settings

pinguet62/pYtunes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pYtunes

Read iTunes library file.

Using

Library

To read library:

library = Library("iTunes Music Library.xml")

file = open("iTunes Music Library.xml", "r")
library = Library(file)

file = open("iTunes Music Library.xml", "r")
content = file.read()
library = Library(content)

Playlist

To get the list of playlist names:

print(library.getPlaylistNames()

To get the playlist from its name:

playlist = library.getPlaylist(Playlist.Bibliotheque)
playlist = library.getPlaylist(Playlist.SeriesTV)
playlist = library.getPlaylist(Playlist.Podcasts)
playlist = library.getPlaylist(Playlist.Genius)
playlist = library.getPlaylist(Playlist.Memosvocaux)
playlist = library.getPlaylist(Playlist.Musique)
playlist = library.getPlaylist(Playlist.Films)

playlist = library.getPlaylist("Electro")
playlist = library.getPlaylist("Pop")
...

To get the informations about a playlist:

print(playlist.name)
print(playlist.playlistID)
print(playlist.playlistPersistentID)
print(playlist.allItems)
print(playlist.smartInfo)

To get the tracks of a playlist:

for track in playlist.getTracks():
  pass

Track

To get the informations about a track:

print(track.trackId)
print(track.name)
print(track.artist)
print(track.albumArtist)
print(track.album)
print(track.genre)
print(track.kind)
print(track.size)
print(track.totalTime)
print(track.trackNumber)
print(track.trackCount)
print(track.year)
print(track.dateModified)
print(track.dateAdded)
print(track.bitRate)
print(track.sampleRate)
print(track.comments)
print(track.playCount)
print(track.playDate)
print(track.playDateUTC)
print(track.skipCount)
print(track.skipDate)
print(track.releaseDate)
print(track.rating)
print(track.albumRating)
print(track.albumRatingComputed)
print(track.artworkCount)
print(track.sortAlbum)
print(track.sortName)
print(track.persistentID)
print(track.trackType)
print(track.podcast)
print(track.location)
print(track.fileFolderCount)
print(track.libraryFolderCount)

print(track.rating2)
print(track.location2)

Python version

The pYtunes.py module is compatible with the version 3.3.

But the compare.py script require version 2.7.

Releases

No releases published

Packages

No packages published

Languages