表示iTunes库
iTunesLibrar的Python项目详细描述
iTunesLibrary
iTunesLibrary表示iTunes库。它允许来电者检索项目、播放列表等。
ituneslibrary是drew stephen优秀perl模块http://search.cpan.org/~dinomite/Mac-itunesLibrary的一个端口。Perl语言 库将not逐字重新创建。
安装:pip install ituneslibrary
示例代码
importosfromitunesLibraryimportlibrarypath=os.path.join(os.getenv("HOME"),"Music/iTunes/iTunes Music Library.xml")# must first parse...lib=library.parse(path)printlen(lib)# number of items storedforplaylistinlib.playlists:foriteminplaylist.items:print(item)# perform function on each item in the playlist# get a single playlistplaylist=lib.getPlaylist("Gray")# get a list of all of the David Bowie songsbowie_items=lib.getItemsForArtist("David Bowie")# get a single songsingle_song=lib.getItemsById("16116")# get the iTunes application versionprintlib.applicationVersion
©史蒂夫·斯科尔尼克scholnicks@gmail.com
麻省理工学院许可证,见https://scholnick.net/license.txt