{"id":41405949,"url":"https://github.com/alecsavvy/ddex-go","last_synced_at":"2026-01-23T13:24:27.670Z","repository":{"id":314185030,"uuid":"1054293498","full_name":"alecsavvy/ddex-go","owner":"alecsavvy","description":"ddex structures in golang (xml, protobuf, json)","archived":false,"fork":false,"pushed_at":"2025-09-15T18:10:34.000Z","size":7260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-15T22:03:40.036Z","etag":null,"topics":["audius","connectrpc","ddex","golang","json","music","openaudio","protobuf","xml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alecsavvy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-10T16:25:10.000Z","updated_at":"2025-09-15T18:10:37.000Z","dependencies_parsed_at":"2025-09-11T04:19:47.513Z","dependency_job_id":"a14d9c3d-1566-4fd7-a909-def8ab68e25a","html_url":"https://github.com/alecsavvy/ddex-go","commit_stats":null,"previous_names":["alecsavvy/ddex-go"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/alecsavvy/ddex-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecsavvy%2Fddex-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecsavvy%2Fddex-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecsavvy%2Fddex-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecsavvy%2Fddex-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alecsavvy","download_url":"https://codeload.github.com/alecsavvy/ddex-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecsavvy%2Fddex-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audius","connectrpc","ddex","golang","json","music","openaudio","protobuf","xml"],"created_at":"2026-01-23T13:24:26.621Z","updated_at":"2026-01-23T13:24:27.635Z","avatar_url":"https://github.com/alecsavvy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DDEX Go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/alecsavvy/ddex-go.svg)](https://pkg.go.dev/github.com/alecsavvy/ddex-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/alecsavvy/ddex-go)](https://goreportcard.com/report/github.com/alecsavvy/ddex-go)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![CI](https://github.com/alecsavvy/ddex-go/workflows/CI/badge.svg)](https://github.com/alecsavvy/ddex-go/actions)\n\nA comprehensive Go implementation of DDEX (Digital Data Exchange) standards with native XML support and Protocol Buffer/JSON serialization.\n\n## What is DDEX?\n\nDDEX is a consortium of leading media companies, music licensing organizations, digital service providers and technical intermediaries that develop and promote the adoption of global standards for the exchange of information and rights data along the digital supply chain.\n\n## Features\n\nThis library provides Go structs with Protocol Buffer, JSON, and XML serialization support for:\n\n- **ERN v4.3.2** (Electronic Release Notification) - For communicating music release information\n- **MEAD v1.1** (Media Enrichment and Description) - For enriching media metadata\n- **PIE v1.0** (Party Identification and Enrichment) - For party/artist information and awards\n\n### Key Capabilities\n\n- **Native XML support**: Full XML marshal/unmarshal with complete DDEX XSD compliance\n- **Protocol Buffer serialization**: Efficient binary format for high-performance applications\n- **JSON serialization**: Standard Go JSON support for REST APIs and web services\n- **gRPC/ConnectRPC ready**: Protocol Buffer definitions work seamlessly with RPC frameworks\n- **Bidirectional conversion**: Convert between XML, JSON, and protobuf without data loss\n- **Type safety**: Strong typing with comprehensive test coverage and validation\n\n## Installation\n\n```bash\ngo get github.com/alecsavvy/ddex-go@latest\n```\n\n## Quick Start\n\n### Basic XML Parsing\n\n```go\npackage main\n\nimport (\n    \"encoding/xml\"\n    \"fmt\"\n    \"os\"\n\n    \"github.com/alecsavvy/ddex-go\"\n    ernv432 \"github.com/alecsavvy/ddex-go/gen/ddex/ern/v432\"\n)\n\nfunc main() {\n    // Read DDEX XML file\n    xmlData, err := os.ReadFile(\"release.xml\")\n    if err != nil {\n        panic(err)\n    }\n\n    // Unmarshal into typed struct\n    var release ernv432.NewReleaseMessage\n    err = xml.Unmarshal(xmlData, \u0026release)\n    if err != nil {\n        panic(err)\n    }\n\n    // Access structured data\n    fmt.Printf(\"Message ID: %s\\n\", release.MessageHeader.MessageId)\n\n    // Convert back to XML with proper header\n    regeneratedXML, err := xml.MarshalIndent(\u0026release, \"\", \"  \")\n    if err != nil {\n        panic(err)\n    }\n\n    // Add XML declaration for complete DDEX document\n    fullXML := xml.Header + string(regeneratedXML)\n    fmt.Println(fullXML)\n\n    // Use type aliases for convenience\n    var typedRelease ddex.NewReleaseMessageV432 = release\n    fmt.Printf(\"Release Count: %d\\n\", len(typedRelease.ReleaseList.TrackRelease))\n}\n```\n\n### Protocol Buffer and JSON Serialization\n\n```go\npackage main\n\nimport (\n    \"encoding/json\"\n    \"encoding/xml\"\n    \"fmt\"\n    ernv432 \"github.com/alecsavvy/ddex-go/gen/ddex/ern/v432\"\n    \"google.golang.org/protobuf/proto\"\n)\n\nfunc main() {\n    // Create a new release message\n    release := \u0026ernv432.NewReleaseMessage{\n        MessageHeader: \u0026ernv432.MessageHeader{\n            MessageId: \"MSG-12345\",\n        },\n    }\n\n    // Serialize to Protocol Buffer binary format\n    protoData, err := proto.Marshal(release)\n    if err != nil {\n        panic(err)\n    }\n\n    // Serialize to JSON\n    jsonData, err := json.Marshal(release)\n    if err != nil {\n        panic(err)\n    }\n\n    // Serialize to XML with proper DDEX formatting\n    xmlData, err := xml.MarshalIndent(release, \"\", \"  \")\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Printf(\"Proto size: %d bytes\\n\", len(protoData))\n    fmt.Printf(\"JSON: %s\\n\", string(jsonData))\n    fmt.Printf(\"XML:\\n%s%s\\n\", xml.Header, string(xmlData))\n\n    // Deserialize from binary format\n    var decoded ernv432.NewReleaseMessage\n    err = proto.Unmarshal(protoData, \u0026decoded)\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Printf(\"Message ID: %s\\n\", decoded.MessageHeader.MessageId)\n}\n```\n\n## Supported Message Types\n\n### ERN (Electronic Release Notification) v4.3.2\n- `NewReleaseMessage` - New music releases\n- `PurgeReleaseMessage` - Release removal notifications\n\n### MEAD (Media Enrichment and Description) v1.1  \n- `MeadMessage` - Media metadata enrichment\n\n### PIE (Party Identification and Enrichment) v1.0\n- `PieMessage` - Party/artist information\n- `PieRequestMessage` - Party information requests\n\n## Type Aliases\n\nFor convenience, the main package exports versioned type aliases:\n\n```go\n// ERN v4.3.2 - Main message types\ntype NewReleaseMessageV432   = ernv432.NewReleaseMessage\ntype PurgeReleaseMessageV432 = ernv432.PurgeReleaseMessage\n\n// MEAD v1.1 types\ntype MeadMessageV11 = meadv11.MeadMessage\n\n// PIE v1.0 types\ntype PieMessageV10        = piev10.PieMessage\ntype PieRequestMessageV10 = piev10.PieRequestMessage\n```\n\n## Examples\n\n### Testing with Real DDEX Files\n\nThe `examples/proto/` directory contains a comprehensive tool for parsing and validating DDEX files:\n\n```bash\n# Parse any DDEX file - automatically detects message type\ngo run examples/proto/main.go -file path/to/your/ddex-file.xml\n\n# Examples with different message types\ngo run examples/proto/main.go -file testdata/ernv432/Samples43/1\\ Audio.xml\ngo run examples/proto/main.go -file testdata/meadv11/mead_award_example.xml\ngo run examples/proto/main.go -file testdata/piev10/pie_award_example.xml\n```\n\nFor safely storing real DDEX files for testing, create a `test-files/` or `ddex-samples/` directory (gitignored):\n\n```bash\nmkdir test-files\n# Copy your DDEX files here\ngo run examples/proto/main.go -file test-files/sample.xml\n```\n\nThe example automatically detects the message type (ERN, MEAD, or PIE) and provides detailed output using `spew.Dump()` for easy inspection.\n\n## Development\n\n### Running Tests\n\n```bash\n# Run all tests including comprehensive validation\nmake test\n\n# Run specific test suites\nmake test-comprehensive  # Conformance, roundtrip, and completeness tests\nmake test-roundtrip     # XML bidirectional conversion tests\nmake benchmark          # Performance benchmarks\n```\n\n**Test Coverage:**\n- **Conformance tests**: Validate against official DDEX sample files\n- **Roundtrip tests**: Ensure XML ↔ protobuf conversion without data loss\n- **Field completeness**: Verify all XSD fields are properly mapped\n- **Performance benchmarks**: Memory and speed optimization validation\n\n**Test Data:**\n- **ERN test files**: Official DDEX consortium sample files (complete accuracy)\n- **MEAD/PIE test files**: Manually created examples (representative but not exhaustive)\n\n### Code Generation\n\nThe library uses a sophisticated generation pipeline:\n\n```bash\n# Complete generation workflow\nmake generate           # XSD → proto → Go with XML tags\n\n# Individual steps\nmake generate-proto     # XSD schemas → Protocol Buffer definitions\nmake generate-proto-go  # Proto files → Go structs with XML tags\nmake buf-generate      # Alternative: use buf for Go generation\nmake buf-lint          # Lint protobuf files\n\n# See all available commands\nmake help\n```\n\n### Generation Pipeline Details\n\n1. **XSD → Proto**: `tools/xsd2proto/` converts DDEX XSD schemas to protobuf with XML annotations\n2. **Proto → Go**: `buf generate` creates Go structs with protobuf support\n3. **XML Tag Injection**: `protoc-go-inject-tag` adds XML struct tags for DDEX compatibility\n4. **Go Extensions**: `tools/generate-go-extensions/` generates enum strings and XML methods\n\n### Manual Commands\n\n```bash\n# Run tests without generation\ngo test -v ./...\n\n# Clean generated files and test data\nmake clean\n\n# Force refresh of test data\nmake testdata-refresh\n```\n\n## Repository Structure\n\n```\nddex-go/\n├── proto/                   # Protocol Buffer definitions with XML tags\n│   └── ddex/               # Namespace-aware proto organization\n│       ├── avs/            # Allowed Value Sets (enums shared across specs)\n│       ├── ern/v432/       # ERN v4.3.2 .proto files\n│       ├── mead/v11/       # MEAD v1.1 .proto files\n│       └── pie/v10/        # PIE v1.0 .proto files\n│\n├── gen/                     # Generated Go code from proto files\n│   └── ddex/               # Mirrors proto structure\n│       ├── avs/            # Shared enum types with proper XML tags\n│       ├── ern/v432/       # ERN Go code with protobuf + XML support\n│       ├── mead/v11/       # MEAD Go code with protobuf + XML support\n│       └── pie/v10/        # PIE Go code with protobuf + XML support\n│\n├── tools/                   # Generation and conversion tools\n│   ├── xsd2proto/          # XSD to Proto converter with namespace-aware imports\n│   └── generate-enum-strings/ # Enum string method generator\n│\n├── examples/                # Usage examples and documentation\n│   └── proto/              # Comprehensive parsing example (supports all message types)\n│\n├── testdata/                # Test files for validation\n│   ├── ernv432/           # Official DDEX consortium sample files\n│   ├── meadv11/           # MEAD test examples\n│   └── piev10/            # PIE test examples\n│\n├── xsd/                     # Original DDEX XSD schema files\n│   ├── ernv432/           # ERN v4.3.2 XSD files\n│   ├── meadv11/           # MEAD v1.1 XSD files\n│   └── piev10/            # PIE v1.0 XSD files\n│\n├── buf.yaml                 # Protocol Buffer configuration\n├── buf.gen.yaml            # Code generation configuration\n├── Makefile                # Build automation\n└── ddex.go                 # Main package with type aliases\n```\n\n## Architecture and Serialization\n\nThis library implements native XML support with Protocol Buffer and JSON serialization:\n\n### Core Architecture\n- **Native XML support**: Direct XML marshal/unmarshal with full DDEX XSD compliance\n- **Protocol Buffer definitions**: High-performance binary serialization for microservices\n- **JSON serialization**: Standard Go JSON support for REST APIs and web services\n- **Shared enum types** in `ddex/avs/` package used across all DDEX specifications\n- **Namespace-aware imports** ensure proper XSD compliance and proto organization\n\n### Benefits\n- **DDEX Compliance**: Native XML support ensures perfect DDEX standard compliance\n- **Performance**: Binary protobuf serialization for high-throughput applications\n- **Interoperability**: Native gRPC/ConnectRPC support for microservices\n- **Type Safety**: Strong typing with comprehensive validation and test coverage\n- **Flexibility**: Convert seamlessly between XML, JSON, and protobuf formats\n\n### Usage Patterns\n- Use **XML** for DDEX standard compliance and external integrations\n- Use **JSON** for REST APIs, web services, and JavaScript interoperability\n- Use **Protocol Buffers** for internal APIs, microservices, and performance-critical applications\n- Convert seamlessly between all three formats as needed\n\n## License\n\nThis library is for working with DDEX standards. DDEX specifications are developed by the DDEX consortium.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecsavvy%2Fddex-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecsavvy%2Fddex-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecsavvy%2Fddex-go/lists"}