Skip to main content

Tool to get any information about iTunes tracks and playlists quickly and easily

Project description

IReadiTunes

Tool to get any information about iTunes tracks and playlists quickly and easily.

Installation

Use the package manager pip to install IReadiTunes.

pip install IReadiTunes

Example code

import IReadiTunes as irit

# First of all, init the library
my_lib = irit.lib_init()

# Read iTunes XML file
my_lib.parse(r'path\to\file\iTunes Music Library.xml')

# Get name of playlists
lib_list = my_lib.get_playlist_list()

print("iTunes playlists: ")
for itunes_library in lib_list:
    print("\t" + itunes_library)  # Print name of each playlist

lib_to_analyse = ""
while lib_to_analyse not in lib_list:
    lib_to_analyse = input("Enter name of library you want to analyse: ")  # Prompt the user to enter the name of the playlist to be scanned. 


playlist_with_attributs = my_lib.get_playlist_contents(lib_to_analyse)  # Analyse choosen playlist

print("\n{} playlist content:".format(lib_to_analyse))

# Print attributs of each element stored in the given playlist
nb_of_tracks = len(playlist_with_attributs)
track_ind = 0 
for track in playlist_with_attributs:
    print("Track [{}/{}]:".format(track_ind+1, nb_of_tracks))
    print("\ttrack_id: {}".format(track.track_id))
    print("\tsize: {} Mb".format(irit.get_size(track.size)))
    print("\ttotal_time: {} seconds".format(irit.get_total_time(track.total_time)))
    print("\tdate_modified: {}".format(track.date_modified))
    print("\tdate_added: {}".format(track.date_added))
    print("\tbitrate: {} kbps".format(track.bitrate))
    print("\tsample_rate: {} kHz".format(track.sample_rate))
    print("\tplay_count: {}".format(track.play_count))
    print("\tplay_date: {}".format(track.play_date))
    print("\tplay_date_utc: {}".format(track.play_date_utc))
    print("\tskip_count: {}".format(track.skip_count))
    print("\tskip_date: {}".format(track.skip_date))
    print("\trating: {} stars".format(irit.get_rating(track.rating)))
    print("\talbum_rating: {} stars".format(irit.get_rating(track.album_rating)))
    print("\tpersistent_id: {}".format(track.persistent_id))
    print("\ttrack_type: {}".format(track.track_type))
    print("\tfile_folder_count: {}".format(track.file_folder_count))
    print("\tlibrary_folder_count: {}".format(track.library_folder_count))
    print("\tname: {}".format(track.name))
    print("\tartist: {}".format(track.artist))
    print("\tkind: {}".format(track.kind))
    print("\tlocation: {}".format(irit.get_track_path(track.location)))
    print()
    
    track_ind += 1

Features

  • Fast library decoding
  • Simple, easy to understand code.

Contributing

All contributions are welcome. Do not hesitate to contact me in case of bugs or ideas for improvement.

License

MIT

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

IReadiTunes-1.0.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

IReadiTunes-1.0.5-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file IReadiTunes-1.0.5.tar.gz.

File metadata

  • Download URL: IReadiTunes-1.0.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.0

File hashes

Hashes for IReadiTunes-1.0.5.tar.gz
Algorithm Hash digest
SHA256 3dcc948628049b74c4ce1fc819aed8133604bf1f8d74342d3d13ae497c75592f
MD5 7e2688186946bcef72c093c232cb65c5
BLAKE2b-256 890bb6e0aa6d03f99f6d05536fdf0feca8fa359f72f3b39b0e464110fc84c166

See more details on using hashes here.

File details

Details for the file IReadiTunes-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: IReadiTunes-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.0

File hashes

Hashes for IReadiTunes-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dd2f4e72ecab09a13a9e900bec339fbc1e4c99a7457b019b0be93a619172bcb7
MD5 f73e256916f4f125b4100cf85045ae1b
BLAKE2b-256 04766b49d1ba67ed5a8fed0049c0bfd92a7fc10456821eca4bbbd8f1b1883803

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