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

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.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

iTunesLibrary-1.2.1-py2.py3-none-any.whl (6.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ituneslibrary-1.2.1.tar.gz.

File metadata

  • Download URL: ituneslibrary-1.2.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for ituneslibrary-1.2.1.tar.gz
Algorithm Hash digest
SHA256 80ecbadfc3a7bdaf0efb3acdad1635fe9e85e11d54103400f7d2b4216fcd17f2
MD5 ca4dec6bf4cd15943d9996471895bc6f
BLAKE2b-256 9746010859c8f4c0a2bd5657f02cc906b3550ee7ed60f19a883700ab7409b330

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iTunesLibrary-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5bc3ad035050a592bb1ce79b2db190f43d2fb24bad83c645721cb1c75b11fc03
MD5 9a7af151ac3fd8152da50d0b62e56eeb
BLAKE2b-256 648c01436c1f5834fec8e932d83b8ab7ba5a2f0554b96ed0754a033638bf346c

See more details on using hashes here.

Supported by

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