Skip to main content

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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iTunesLibrary-1.2.0-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file iTunesLibrary-1.2.0.tar.gz.

File metadata

  • Download URL: iTunesLibrary-1.2.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for iTunesLibrary-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f24e0fab469846b9a38d6fe44b392b3b7b0270dd861fcf0618935d8a014ef906
MD5 ffef7cede9a811193367c166e2cbc48f
BLAKE2b-256 834104a940b42bddc32c66d487c633ec96547abe8e53bac6a5fdc04a5d46cbd2

See more details on using hashes here.

File details

Details for the file iTunesLibrary-1.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: iTunesLibrary-1.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for iTunesLibrary-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4eabe81a88386b948ba3fcd3bd396b367f3c62315aee99e655f8bb53ec99ce8e
MD5 f324126ada6cc5c09bfab36c6d71dc71
BLAKE2b-256 c8de80b9cefd983129e87276a9e464950dc17fc50414a45e5cecb7ca51bd15e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page