# DDEX Builder - Python Bindings
[](https://pypi.org/project/ddex-builder/)
[](https://pypi.org/project/ddex-builder/)
[](https://pypi.org/project/ddex-builder/)
[](https://opensource.org/licenses/MIT)
Generate deterministic, industry-compliant DDEX XML files from Python data structures with byte-perfect reproducibility. Build DDEX messages from dictionaries, DataFrames, or parsed objects with built-in validation and partner-specific presets.
## Installation
```bash
pip install ddex-builder
```
## Security Notice
**v0.4.0 includes PyO3 0.24 upgrade for enhanced security and compatibility.**
## Quick Start
```python
from ddex_builder import DDEXBuilder
import pandas as pd
# Create builder with validation
builder = DDEXBuilder(validate=True)
# Build from dictionary
release_data = {
'message_header': {
'sender_name': 'My Label',
'message_id': 'MSG123',
},
'releases': [{
'title': 'My Album',
'main_artist': 'Great Artist',
'tracks': [{
'title': 'Track 1',
'duration': 180,
'isrc': 'US1234567890'
}]
}]
}
xml_output = builder.build_from_dict(release_data, version='4.3')
print(xml_output[:100] + '...')
```
## Features
### 🎯 Deterministic Output
- **100% reproducible** XML generation with stable hash IDs
- DB-C14N/1.0 canonicalization for byte-perfect consistency
- IndexMap-based ordering ensures identical output across runs
- Content-addressable resource IDs for reliable references
### 🏭 Industry Presets
- **YouTube Music**: Content ID and monetization standards
- **Generic**: Default preset suitable for most distributors
### 📊 DataFrame Integration
- Build directly from pandas DataFrames
- Automatic schema detection and validation
- Support for hierarchical data structures
- Export/import workflows with CSV and Parquet
### 🔒 Built-in Validation
- Comprehensive DDEX schema validation
- Business rule enforcement
- Reference integrity checking
- Territory and rights validation
### 🚀 High Performance
- Native Rust implementation with Python bindings
- Streaming generation for large catalogs
- Memory-efficient processing
- Parallel resource processing
## API Reference
### DDEXBuilder
```python
from ddex_builder import DDEXBuilder
builder = DDEXBuilder(
validate=True, # Enable validation (recommended)
preset='generic', # Use generic industry preset
canonical=True, # Generate canonical XML
streaming=False, # Enable streaming mode for large data
max_memory=100_000_000 # Memory limit in bytes
)
```
## Performance Benchmarks
Building performance on different dataset sizes:
| Dataset Size | Build Time | Memory Usage | Output Size |
|--------------|------------|-------------|------------|
| Single release (10 tracks) | 2ms | 5MB | 25KB |
| Album catalog (100 releases) | 15ms | 25MB | 2.5MB |
| Label catalog (1000 releases) | 120ms | 80MB | 25MB |
| Large catalog (10000 releases) | 1.2s | 200MB | 250MB |
Memory usage scales linearly, with streaming mode keeping usage constant for any dataset size.
## Integration with ddex-parser
Round-trip compatibility with ddex-parser for complete workflows:
```python
from ddex_parser import DDEXParser
from ddex_builder import DDEXBuilder
# Parse existing DDEX file
parser = DDEXParser()
original = parser.parse_file("input.xml")
# Modify data
modified_data = original.to_dict()
modified_data['tracks'][0]['title'] = "New Title"
# Build new DDEX file
builder = DDEXBuilder()
new_xml = builder.build_from_dict(modified_data)
# Verify round-trip integrity
new_result = parser.parse_string(new_xml)
assert new_result.tracks[0].title == "New Title"
```
## Requirements
- Python 3.8+
- pandas (optional, for DataFrame support)
- PyO3 0.24 compatible runtime
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/daddykev/ddex-suite/blob/main/LICENSE) file for details.
## Related Projects
- **[ddex-parser](https://pypi.org/project/ddex-parser/)** - Parse DDEX XML files to Python structures
- **[ddex-builder (npm)](https://www.npmjs.com/package/ddex-builder)** - JavaScript/TypeScript bindings
- **[DDEX Suite](https://ddex-suite.org)** - Complete DDEX processing toolkit
---
Built with ❤️ for the music industry. Engineered for deterministic, industry-grade DDEX generation.
Raw data
{
"_id": null,
"home_page": null,
"name": "ddex-builder",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ddex, xml, builder, music, deterministic, canonicalization",
"author": "Kevin Marques Moo",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/58/1b/04ca35e6e910d505fc4c56cfb90322087f59a1ac1dda3fa37b1010c9c84d/ddex_builder-0.4.0.tar.gz",
"platform": null,
"description": "# DDEX Builder - Python Bindings\n\n[](https://pypi.org/project/ddex-builder/)\n[](https://pypi.org/project/ddex-builder/)\n[](https://pypi.org/project/ddex-builder/)\n[](https://opensource.org/licenses/MIT)\n\nGenerate deterministic, industry-compliant DDEX XML files from Python data structures with byte-perfect reproducibility. Build DDEX messages from dictionaries, DataFrames, or parsed objects with built-in validation and partner-specific presets.\n\n## Installation\n\n```bash\npip install ddex-builder\n```\n\n## Security Notice\n**v0.4.0 includes PyO3 0.24 upgrade for enhanced security and compatibility.**\n\n## Quick Start\n\n```python\nfrom ddex_builder import DDEXBuilder\nimport pandas as pd\n\n# Create builder with validation\nbuilder = DDEXBuilder(validate=True)\n\n# Build from dictionary\nrelease_data = {\n 'message_header': {\n 'sender_name': 'My Label',\n 'message_id': 'MSG123',\n },\n 'releases': [{\n 'title': 'My Album',\n 'main_artist': 'Great Artist',\n 'tracks': [{\n 'title': 'Track 1',\n 'duration': 180,\n 'isrc': 'US1234567890'\n }]\n }]\n}\n\nxml_output = builder.build_from_dict(release_data, version='4.3')\nprint(xml_output[:100] + '...')\n```\n\n## Features\n\n### \ud83c\udfaf Deterministic Output\n- **100% reproducible** XML generation with stable hash IDs\n- DB-C14N/1.0 canonicalization for byte-perfect consistency\n- IndexMap-based ordering ensures identical output across runs\n- Content-addressable resource IDs for reliable references\n\n### \ud83c\udfed Industry Presets\n- **YouTube Music**: Content ID and monetization standards\n- **Generic**: Default preset suitable for most distributors\n\n### \ud83d\udcca DataFrame Integration\n- Build directly from pandas DataFrames\n- Automatic schema detection and validation\n- Support for hierarchical data structures\n- Export/import workflows with CSV and Parquet\n\n### \ud83d\udd12 Built-in Validation\n- Comprehensive DDEX schema validation\n- Business rule enforcement\n- Reference integrity checking\n- Territory and rights validation\n\n### \ud83d\ude80 High Performance\n- Native Rust implementation with Python bindings\n- Streaming generation for large catalogs\n- Memory-efficient processing\n- Parallel resource processing\n\n## API Reference\n\n### DDEXBuilder\n\n```python\nfrom ddex_builder import DDEXBuilder\n\nbuilder = DDEXBuilder(\n validate=True, # Enable validation (recommended)\n preset='generic', # Use generic industry preset\n canonical=True, # Generate canonical XML\n streaming=False, # Enable streaming mode for large data\n max_memory=100_000_000 # Memory limit in bytes\n)\n```\n\n## Performance Benchmarks\n\nBuilding performance on different dataset sizes:\n\n| Dataset Size | Build Time | Memory Usage | Output Size |\n|--------------|------------|-------------|------------|\n| Single release (10 tracks) | 2ms | 5MB | 25KB |\n| Album catalog (100 releases) | 15ms | 25MB | 2.5MB |\n| Label catalog (1000 releases) | 120ms | 80MB | 25MB |\n| Large catalog (10000 releases) | 1.2s | 200MB | 250MB |\n\nMemory usage scales linearly, with streaming mode keeping usage constant for any dataset size.\n\n## Integration with ddex-parser\n\nRound-trip compatibility with ddex-parser for complete workflows:\n\n```python\nfrom ddex_parser import DDEXParser\nfrom ddex_builder import DDEXBuilder\n\n# Parse existing DDEX file\nparser = DDEXParser()\noriginal = parser.parse_file(\"input.xml\")\n\n# Modify data\nmodified_data = original.to_dict()\nmodified_data['tracks'][0]['title'] = \"New Title\"\n\n# Build new DDEX file\nbuilder = DDEXBuilder()\nnew_xml = builder.build_from_dict(modified_data)\n\n# Verify round-trip integrity\nnew_result = parser.parse_string(new_xml)\nassert new_result.tracks[0].title == \"New Title\"\n```\n\n## Requirements\n- Python 3.8+\n- pandas (optional, for DataFrame support)\n- PyO3 0.24 compatible runtime\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/daddykev/ddex-suite/blob/main/LICENSE) file for details.\n\n## Related Projects\n\n- **[ddex-parser](https://pypi.org/project/ddex-parser/)** - Parse DDEX XML files to Python structures\n- **[ddex-builder (npm)](https://www.npmjs.com/package/ddex-builder)** - JavaScript/TypeScript bindings\n- **[DDEX Suite](https://ddex-suite.org)** - Complete DDEX processing toolkit\n\n---\n\nBuilt with \u2764\ufe0f for the music industry. Engineered for deterministic, industry-grade DDEX generation.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "High-performance DDEX XML builder with deterministic output and smart normalization",
"version": "0.4.0",
"project_urls": {
"documentation": "https://github.com/daddykev/ddex-suite/tree/main/packages/ddex-builder",
"homepage": "https://github.com/daddykev/ddex-suite",
"repository": "https://github.com/daddykev/ddex-suite"
},
"split_keywords": [
"ddex",
" xml",
" builder",
" music",
" deterministic",
" canonicalization"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bfa0d569144790d59a35e0b3c37e68a250313af5b29b2ee823f854d502a2733a",
"md5": "c1776a2a8bafa0593da0090a59e767db",
"sha256": "cd1e6a45b542e8f2ed05ce9e7cfa68dcda4f46e895425359c7dc48aa523aa8d4"
},
"downloads": -1,
"filename": "ddex_builder-0.4.0-cp38-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "c1776a2a8bafa0593da0090a59e767db",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 1135728,
"upload_time": "2025-09-15T01:28:23",
"upload_time_iso_8601": "2025-09-15T01:28:23.071043Z",
"url": "https://files.pythonhosted.org/packages/bf/a0/d569144790d59a35e0b3c37e68a250313af5b29b2ee823f854d502a2733a/ddex_builder-0.4.0-cp38-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "581b04ca35e6e910d505fc4c56cfb90322087f59a1ac1dda3fa37b1010c9c84d",
"md5": "d4550cc41ab81bfd531864274bcaeda4",
"sha256": "7c9f071500235c1aafd8c8b048999788e2eda0fe0788fbb760bfd57eef5ab4cd"
},
"downloads": -1,
"filename": "ddex_builder-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "d4550cc41ab81bfd531864274bcaeda4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 656127,
"upload_time": "2025-09-15T01:28:24",
"upload_time_iso_8601": "2025-09-15T01:28:24.924200Z",
"url": "https://files.pythonhosted.org/packages/58/1b/04ca35e6e910d505fc4c56cfb90322087f59a1ac1dda3fa37b1010c9c84d/ddex_builder-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-15 01:28:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "daddykev",
"github_project": "ddex-suite",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ddex-builder"
}