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")
# check the playlist type
assert(not playlist.is_smart())
assert(not playlist.is_folder())
# 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)
Contributors
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.2.0.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for iTunesLibrary-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eabe81a88386b948ba3fcd3bd396b367f3c62315aee99e655f8bb53ec99ce8e |
|
MD5 | f324126ada6cc5c09bfab36c6d71dc71 |
|
BLAKE2b-256 | c8de80b9cefd983129e87276a9e464950dc17fc50414a45e5cecb7ca51bd15e1 |