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.4.tar.gz (25.1 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.4-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ituneslibrary-1.2.4.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ituneslibrary-1.2.4.tar.gz
Algorithm Hash digest
SHA256 7e82d068fefeff6a915217bccd525909a6af0953c723da32b2c35255b756e167
MD5 687d9067be224dc2afeaeb52e392687c
BLAKE2b-256 776b8e8f79be82bc18875f883cfd34e9937386bb06bca4e02029397d5fc68380

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ituneslibrary-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ituneslibrary-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 df19c34cc133f139e80fb3c928b796c6ebac4b4df5f8d28731784b826a4bfe0b
MD5 cd80771b85e4bf389f3ec7421a129372
BLAKE2b-256 251b0577911fedce17fe8d4b7693535944241b0fe5a3c108079ae21367855c81

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