Represents an iTunes library
Project description
itunesLibrary
itunesLibrary represents an iTunes Library. It allows the caller to retrieve items, playlists, etc.
itunesLibrary is a port of Drew Stephen's excellent Perl module, https://github.com/dinomite/Mac-iTunes-Library. The Perl library will be not re-created verbatim.
Installation : pip install itunesLibrary
Example Code
import os
from itunesLibrary import library
path = os.path.join(os.getenv("HOME"),"Music/iTunes/iTunes Music Library.xml")
# must first parse...
lib = library.parse(path)
print len(lib) # number of items stored
for playlist in lib.playlists:
for item in playlist.items:
print(item) # perform function on each item in the playlist
# get a single playlist
playlist = lib.getPlaylist("Gray")
# get a list of all of the David Bowie songs
bowie_items = lib.getItemsForArtist("David Bowie")
# get a single song
single_song = lib.getItemsById("16116")
# get the iTunes application version
print(lib.applicationVersion)
© Steve Scholnick scholnicks@gmail.com
MIT License, see https://scholnick.net/license.txt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iTunesLibrary-1.1.5.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for iTunesLibrary-1.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6fa9e42ce06d0c2e292e02a57acb742e8a9c6742d17b3029e7579fb3484ee3a |
|
MD5 | be47076135e5ed8b551848db51ccfde4 |
|
BLAKE2b-256 | af41d5d62851cdce343c494c407621c2559d7107947a65d71edfdce12e85e3be |