PHPackages                             miqwit/dedex - 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. [Image &amp; Media](/categories/media)
4. /
5. miqwit/dedex

ActiveLibrary[Image &amp; Media](/categories/media)

miqwit/dedex
============

Parse DDEX ERN files and provide a convenient API to use it

2.2.0(3mo ago)3038.0k—6.6%14[2 issues](https://github.com/miqwit/dedex/issues)[1 PRs](https://github.com/miqwit/dedex/pulls)MITPHPPHP ^7.2|^8.0CI failing

Since Nov 14Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/miqwit/dedex)[ Packagist](https://packagist.org/packages/miqwit/dedex)[ Docs](https://github.com/miqwit/dedex)[ RSS](/packages/miqwit-dedex/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (31)Used By (0)

DeDEX
=====

[](#dedex)

DeDEX is a DDEX XML file parser. DDEX is a standard used in the music industry to deliver rich media content. See more info at [ddex.net](https://ddex.net/). This covers only the ERN (Electronic Release Notification) standard, for versions 3.8.2 and 4.1.

In my past experiences as a developer, I always had to develop or enhanced a DDEX parser for ERN. I created one here that is as convenient to use as I always hoped for.

The **Rule** mechanism is pretty useful and flexible. The DDEX ERN standard is extremely vast and there are many ways to use it. Most providers generate a simplified yet comprehensive XML file covering most of the needs. The Rules helps checking during the parsing that not only the XML is valid, but contain the minimal consistent information.

It is possible to implement your own rules ([contribute](CONTRIBUTE.md) to this repository if you think other developers could make a use of it), and to implement a different set of rules for different provider.

For instance, it is possible to enforce that for a given XML the ISRC is provided for all recordings, but not for another one. Providers rules can be modelled in a **Rules Set**.

If you find this useful, please star this repository.

This repository provides **Simple Entities** that can be handy to parse your first XML files. They give a simplified model of an Album, with Tracks, Artists and Deals attached. You can ignored the Simple Entities and build your own set or superset of entities to serve your needs. Note that the Simple Entities give a limited usage of DDEX. Read the documentation carefully before using it.

Installation
------------

[](#installation)

```
composer require miqwit/dedex

```

Usage
-----

[](#usage)

### Convert a DDEX file to a SimpleAlbum

[](#convert-a-ddex-file-to-a-simplealbum)

```
use DedexBundle\Controller\ErnParserController;
use DedexBundle\Simplifiers\SimpleAlbum;

$xml_path = "tests/samples/with_assets/004_complete/1199119911991.xml";
$parser = new ErnParserController();
$ern = $parser->parse($xml_path);
$album = new SimpleAlbum($ern);

// Then you can access high level property of this album
$release_date = $album->getOriginalReleaseDate();
$artists_at_album_level = $album->getArtists();
$tracks_for_cd_1 = $album->getTracksPerCd()[1];

// You can also access exact XML mapping by getting
// ddex objects at album or track level
$ddex_release = $album->getDdexRelease();
$ddex_release->getReleaseId()[0]->getICPN()->value(); // direct access
$ddex_track = $tracks_for_cd_1[1]->getDdexSoundRecording()->getDuration(); // direct access
```

### Parse a file without XSD validation

[](#parse-a-file-without-xsd-validation)

```
use DedexBundle\Controller\ErnParserController;

$xml_path = "tests/samples/001_audioalbum_complete.xml";
$parser = new ErnParserController();
$ern = $parser->parse($xml_path);

// Then you can access properties of the ERN
$created_at = $ern->getMessageHeader()->getMessageCreatedDateTime();
```

### Parse a file with XSD validation

[](#parse-a-file-with-xsd-validation)

XSD validation will load all XML and XSD in memory, making this library less efficient. Use with care. Is not adapted to gigantic files.

```
use DedexBundle\Controller\ErnParserController;

$xml_path = "tests/samples/001_audioalbum_complete.xml";
$parser = new ErnParserController();
$parser->setXsdValidation(true);
$ern = $parser->parse($xml_path);
```

### Parse a file with Rules

[](#parse-a-file-with-rules)

```
use DedexBundle\Controller\ErnParserController;
use DedexBundle\Rule\AtLeastOneImage;
use DedexBundle\Exception\RuleValidationException;

$xml_path = "tests/samples/001_audioalbum_complete.xml";
$parser = new ErnParserController();
$parser->addRule(new AtLeastOneImage(Rule::LEVEL_ERROR));
// ... can add multiple rules one by one
// ... or multiple rules with $parser->addRuleSet([])
$ern = $parser->parse($xml_path);  // will raise an RuleValidationException if rule is broken
```

Parser config
-------------

[](#parser-config)

Here are handy function from the parser.

`$parser=new ErnParserController();`

```
$parser->setDisplayLog(true);
```

Displays parsing logs. For debugging purpose mainly. (default: `false`)

```
$parser->setXsdValidation(true);
```

Validates XML against XSD. (default: `false` because will load XSD and XML in memory)

```
$parser->getRuleMessages();
```

Returns a formatted string (with new lines) of all the errors generated by the rule checking. To be called when parsing ended. If one of the `ERROR` rules fail, the parser will throw an exception with these messages. In the case of only `WARNING` raised during the parsing, this function is the only way to read them.

```
$parser->addRuleSet();
```

Will store a set of Rule (array). For example, each provider could be check with a specific rule set.

Standard updates
================

[](#standard-updates)

Official email in September 2024
--------------------------------

[](#official-email-in-september-2024)

> From March 1, 2025, all the versions 3 as well as version 4.0 of the Electronic Release Notification standard, their respective profiles, and choreographies will no longer be supported. This means that from that date, no further updates, bug fixes, or AVS additions will be made to these versions of the ERN standard. Also, the XML schemas and all articles or implementation advice about ERN- 3 and ERN 4.0 will be removed from all DDEX websites. All schemas, standard texts, and supporting information about ERN -4.1, 4.2, and, of course, 4.3.1 will remain.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance85

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 84.8% 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 ~114 days

Recently: every ~277 days

Total

18

Last Release

96d ago

Major Versions

1.0.6 → 2.0.02022-08-02

PHP version history (3 changes)1.0.0PHP ^7.2.5

1.0.1PHP ^7.2

2.0.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5be2eac4c6124a250d2693c18c8a091f407937eb693232a91890f8e3e5ce58c0?d=identicon)[miqwit](/maintainers/miqwit)

---

Top Contributors

[![miqwit](https://avatars.githubusercontent.com/u/7227104?v=4)](https://github.com/miqwit "miqwit (67 commits)")[![ignacioalles](https://avatars.githubusercontent.com/u/13685439?v=4)](https://github.com/ignacioalles "ignacioalles (4 commits)")[![Skyree](https://avatars.githubusercontent.com/u/1636904?v=4)](https://github.com/Skyree "Skyree (3 commits)")[![onelazydev](https://avatars.githubusercontent.com/u/1775619?v=4)](https://github.com/onelazydev "onelazydev (2 commits)")[![edvardas-lg](https://avatars.githubusercontent.com/u/261248813?v=4)](https://github.com/edvardas-lg "edvardas-lg (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![sidz](https://avatars.githubusercontent.com/u/1302230?v=4)](https://github.com/sidz "sidz (1 commits)")

---

Tags

ddexmediamusicparserstandardxmlxmlparsingmusicddex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/miqwit-dedex/health.svg)

```
[![Health](https://phpackages.com/badges/miqwit-dedex/health.svg)](https://phpackages.com/packages/miqwit-dedex)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

132890.0k3](/packages/goat1000-svggraph)[nilportugues/sitemap-component

Standalone sitemap builder 100% standards compliant. Build for PHP5.3 and above.

5056.4k1](/packages/nilportugues-sitemap-component)[sonrisa/sitemap-component

Standalone sitemap builder 100% standards compliant. Build for PHP5.3 and above.

5117.5k](/packages/sonrisa-sitemap-component)[vodka2/vk-audio-token

Library that obtains VK tokens that work for VK audio API. Библиотека для получения токена VK, подходящего для Audio API.

1181.8k](/packages/vodka2-vk-audio-token)[kiwilan/php-audio

PHP package to parse and update audio files metadata, with `JamesHeinrich/getID3`.

3014.1k1](/packages/kiwilan-php-audio)[duncan3dc/domparser

Wrappers for the standard DOMDocument class to provide extra functionality for html/xml parsing

10399.9k3](/packages/duncan3dc-domparser)

PHPackages © 2026

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