PHPackages                             dajoho/itunes-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dajoho/itunes-php

ActiveLibrary

dajoho/itunes-php
=================

Parse an iTunes XML file (the full library or partial export) for its info, tracks and playlists. Original work by Robert A. Wallis, with PHP5 support by Peter Minarik.

1.0.1(6y ago)140LGPL-2.1-onlyPHP

Since Jul 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/dajoho/itunes-php)[ Packagist](https://packagist.org/packages/dajoho/itunes-php)[ RSS](/packages/dajoho-itunes-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

iTunes XML parser for PHP
=========================

[](#itunes-xml-parser-for-php)

#### A class to extract info, tracks and playlists from an iTunes XML file.

[](#a-class-to-extract-info-tracks-and-playlists-from-an-itunes-xml-file)

Original code copyright (c) 2003 by [Robert A. Wallis](http://codetriangle.com/). Dicked around with in 2005 by [Peter Minarik](http://www.wirsindecht.org/), and in 2013 by [Conan Theobald](mailto:me%5Bat%5Dconans%5Bdot%5Dco%5Bdot%5Duk).

LGPL licensed: See [LICENSE](LICENSE)

About
-----

[](#about)

A simple PHP class that will read an iTunes XML file and convert the info, tracks and playlists contained within into an array of objects.

Tracks can be matched to playlist-items by running the `#processPlaylists()`method after opening your XML file.

Supports sorting fields by string, number, and date.

Instructions
------------

[](#instructions)

See [example.php](example.php) for a basic implementation.

```
require_once 'iTunesXMLparser.class.php';

$xml_path = 'iTunes playlist export.xml';

$itunes = new iTunesXMLParser();
$itunes->sort_field = 'Track ID';
$itunes->sort_direction = 'ascending';
$itunes->open( $xml_path );

/*
  "$itunes->data" is now available. print_r to see what's inside:
    print_r( $itunes->data );
*/
```

For conversion to JSON, I recommend using the `jsbeautifier.org`[PHP port](https://github.com/einars/js-beautify/tree/attic-php/php).

Credits
-------

[](#credits)

Based on work by:

-
-

The original author, Robert A. Wallis, can be found here:

-

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 82.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2499d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c078e8e8573ccd37d855b302ec2ab172b32443b30d2d5602b5979f10699cb2b?d=identicon)[dajoho](/maintainers/dajoho)

---

Top Contributors

[![shuckster](https://avatars.githubusercontent.com/u/824991?v=4)](https://github.com/shuckster "shuckster (28 commits)")[![dajoho](https://avatars.githubusercontent.com/u/952436?v=4)](https://github.com/dajoho "dajoho (5 commits)")[![SidRoberts](https://avatars.githubusercontent.com/u/1364214?v=4)](https://github.com/SidRoberts "SidRoberts (1 commits)")

### Embed Badge

![Health badge](/badges/dajoho-itunes-php/health.svg)

```
[![Health](https://phpackages.com/badges/dajoho-itunes-php/health.svg)](https://phpackages.com/packages/dajoho-itunes-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
