Skip to content

homebysix/GraphMyTunes

Repository files navigation

GraphMyTunes

License Python 3.13


Overview

GraphMyTunes builds insightful visualizations using the metadata in your Apple Music (formerly known as iTunes) library. Its goal is to provide data to help you better understand your music listening and curation habits.

Requirements

  • Apple Music app for Mac
  • Python (tested primarily with 3.13, but probably works fine with 3.9 and higher)

Quick Start

Follow these 3 steps to get started analyzing your music library.

Step 1: Install Python and GraphMyTunes

  1. Download and install Python.

  2. Use pip to install GraphMyTunes:

     pip install GraphMyTunes
    

Step 2: Export your music library to XML

  1. In the Apple Music app for Mac, choose File > Library > Export Library.

    [!NOTE] Note: Unfortunately, this option is not available in the Windows version of Apple Music.

  2. Save the XML file to a convenient location.

    [!TIP] Tip: I use a date-based filename like 2025-07-05.xml so that I can save multiple snapshots of my library over time.

Step 3: Run GraphMyTunes

  1. Provide the path to the XML you just saved to GraphMyTunes for analysis.

     graphmytunes ~/Music/2025-07-05.xml --output ~/Music/GraphMyTunesOutput
    
  2. When processing is complete, view your graphs in the folder you specified in --output.

    [!TIP] Tip: If you don't specify an output folder, GraphMyTunes will save your graphs alongside the xml file you provided.

Featured Analyses

GraphMyTunes includes 50+ built-in ways to analyze your music collection, including but not limited to:

Top albums by total play time
Top albums by total play time

Top artists by play count
Top artists by play count

Top decades by play count
Top decades by play count

Top genres by total play time
Top genres by total play time

Plays by hour of day
Plays by hour of day

Plays by day of week
Plays by day of week

Limitations and Scope

  • At this time, GraphMyTunes development is focused around Apple Music only. There are likely other solutions that serve those with Spotify, Amazon, Pandora, or Last.fm libraries.

  • GraphMyTunes is limited by the metadata exported by the Music app. Specifically, the exported XML does not include every date/time you played a track; it only includes the most recent play date/time. Therefore, GraphMyTunes will not be able to surface some listening trends (for example, finding songs you used to listen to a lot but now listen to infrequently).

  • GraphMyTunes does not include single-metric metadata rankings that can easily be done in the Music app itself (for example, listing the top tracks by play count). If you want these, go to the Music app's "Songs" view, adjust the view options to include the desired columns, and sort ascending or descending by that column. GraphMyTunes aims to provide ways to aggregate or group data in ways that the Music app cannot do.

  • Although GraphMyTunes should run on Windows, there is no option to export the library as an XML file in the Windows version of Apple Music.

Support

Found a bug or have a suggestion? First check to see if somebody has already opened a similar issue on GitHub. If not, feel free to open one.

Contributing

Contributions are welcome! You may submit pull requests on GitHub. Please include a detailed description of the change being implemented, and consider including unit tests for any new features. See CONTRIBUTING.md for details.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

About

GraphMyTunes builds insightful visualizations using the metadata in your iTunes library.

Resources

License

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages