Skip to main content

DDEX Suite

Parse and build DDEX ERN XML in Rust, Node.js and Python

Parse

Read ERN 3.8.x, 4.2 and 4.3 into typed data

→

Modify

Work with plain objects in your own code

→

Build

Write schema-valid ERN 4.3, 4.2 or 3.8.2

ddex-parser version on npmddex-builder version on npmLicense

Measured performance

1.7 ms
Parse a typical album (ERN 4.3, 75 KB)
33–47 MiB/s
Parser throughput on real ERN 4.3
211 ms
Parse a ~10 MB catalog
8.3 ms
Build a 12-track album (ERN 4.3)

Parse time by message size (log scale)

10 KB
0.27 ms
75 KB
1.7 ms
330 KB
7.4 ms
10 MB
211 ms

Criterion benches on a GitHub-hosted runner (Intel Xeon, 4 vCPUs), release profile, 0.5.1. Method and full results

Parse and build in three languages

const fs = require('node:fs');
const { DdexParser } = require('ddex-parser');
const { DdexBuilder } = require('ddex-builder');

// Parse any ERN 3.8.x, 4.2 or 4.3 message
const message = new DdexParser().parseSync(fs.readFileSync('release.xml', 'utf8'));
for (const release of message.releases) {
console.log(release.title, 'by', release.displayArtist, release.releaseDates.map((d) => d.date));
for (const track of release.tracks) {
console.log(` ${track.position}. ${track.title} [${track.isrc}]`);
}
}

// Build ERN 4.3: a required field that is missing fails the build, naming the field
const party = (name, id) => ({ party_name: [{ text: name }], party_id: id });
const request = {
header: {
message_sender: party('Example Label', 'PADPIDA0000000001'),
message_recipient: party('Example DSP', 'PADPIDA0000000002'),
},
version: '4.3',
avs_version_id: '12',
language_and_script_code: 'en',
releases: [{
release_id: 'A1-ABCDE-0000000001-M',
title: [{ text: 'Example Single' }],
artist: 'Example Artist',
label: 'Example Label',
release_type: 'Single',
genre: 'Pop',
parental_warning_type: 'NotExplicit',
tracks: [{
track_id: 'T1',
isrc: 'ZZ0000000001',
title: 'Example Track',
duration: 'PT3M42S',
artist: 'Example Artist',
resource_type: 'MusicalWorkSoundRecording',
parental_warning_type: 'NotExplicit',
}],
}],
};
new DdexBuilder().build(request).then((xml) => console.log(xml));
npm install ddex-parser ddex-builder