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
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.4.tar.gz
(4.0 kB
view details)
File details
Details for the file iTunesLibrary-1.1.4.tar.gz.
File metadata
- Download URL: iTunesLibrary-1.1.4.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
437c272174f043964e9a1d772a2a8643f652c990f6e8aea3665315eb3c629170
|
|
| MD5 |
a3596c02520d4376f6be2c6df7fede33
|
|
| BLAKE2b-256 |
bc9042ab7ec1d88b3b4cb5b0f3a8eb8cbb08b9982463f11e1940f84580f535df
|