Skip to main content

itunesLibrary 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.2.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.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ituneslibrary-1.2.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.7 Darwin/25.0.0

File hashes

Hashes for ituneslibrary-1.2.2.tar.gz
Algorithm Hash digest
SHA256 f1c59dd779e6bb0f11db90579356acb5fb9a155899d4bf11dbf4e2a0e9569acc
MD5 7c5756787e1938daeea3c86717e426f7
BLAKE2b-256 a0af29514144842df762f27af371be79d750f4eea411f88986c8fb43523aa75e

See more details on using hashes here.

File details

Details for the file ituneslibrary-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: ituneslibrary-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.7 Darwin/25.0.0

File hashes

Hashes for ituneslibrary-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 02e57ae903eabe91d9d3df6a07041a387490e1a190f2a02c71cdfd296c90ab8e
MD5 667e2d7aaaf237b10a1ec59cd0e8a706
BLAKE2b-256 586cdd076bdf108147afab4c6f552a88cadcf8c6a3daa70f9f06bfa0a4ace624

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