ddex-workbench


Nameddex-workbench JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/daddykev/ddex-workbench
SummaryOfficial Python SDK for DDEX Workbench - Open-source DDEX validation tools
upload_time2025-09-04 02:43:40
maintainerNone
docs_urlNone
authorDDEX Workbench Contributors
requires_python>=3.7
licenseMIT
keywords ddex ern music metadata validation xml music-industry sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DDEX Workbench Python SDK

[![PyPI version](https://img.shields.io/pypi/v/ddex-workbench.svg)](https://pypi.org/project/ddex-workbench/)
[![Python versions](https://img.shields.io/pypi/pyversions/ddex-workbench.svg)](https://pypi.org/project/ddex-workbench/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://ddex-workbench.org/docs)

Official Python SDK for [DDEX Workbench](https://ddex-workbench.org) - Open-source DDEX validation and processing tools for the music industry.

## 🎉 New in Version 1.0.2

- **Enhanced Schematron Rules**: Comprehensive business rule validation with meaningful, actionable SVRL reports
- **SVRL Report Generation**: Generate detailed validation reports in Schematron Validation Report Language format
- **Auto-Detection**: Automatically detect ERN version and profile from XML content
- **Concurrent Batch Processing**: Validate multiple files in parallel with configurable worker pools
- **URL and File Validation**: Validate XML directly from URLs or files with optional hash generation
- **Advanced Error Filtering**: Separate and analyze errors by type (Schematron, XSD, Business Rules)
- **Profile Compliance Reports**: Get detailed compliance statistics with pass/fail rates
- **Metadata Extraction**: Extract message IDs, creation dates, and release counts from XML
- **Enhanced Error Classes**: Specialized error handling for parsing, files, configuration, and API errors
- **Dynamic API Key Management**: Update or clear API keys without recreating client

See [CHANGELOG.md](CHANGELOG.md) for full details.

## Features

- 🚀 **Simple API** - Intuitive methods for all DDEX validation operations
- 🔧 **Full Type Safety** - Type hints, dataclasses, and IDE autocomplete support
- 🌐 **Smart Networking** - Connection pooling, retry logic, and timeout handling
- 📊 **Flexible Validation** - Support for ERN 3.8.2, 4.2, and 4.3 with all profiles
- 🎯 **Comprehensive Error Reporting** - Detailed errors with line numbers, context, and suggestions
- 📈 **Multiple Report Formats** - JSON, CSV, text, and SVRL output formats
- 🔑 **Authentication Support** - API key management for higher rate limits
- ⚡ **High Performance** - Efficient XML processing and parallel batch operations
- 🛡️ **Robust Error Handling** - Specialized exception classes for different error scenarios
- 📦 **Zero Configuration** - Works out of the box with sensible defaults

## Installation

```bash
pip install ddex-workbench
```

For development:
```bash
pip install ddex-workbench[dev]
```

## Quick Start

```python
from ddex_workbench import DDEXClient

# Initialize client (API key optional for higher rate limits)
client = DDEXClient(api_key="ddex_your-api-key")

# Validate ERN XML
with open("release.xml", "r") as f:
    xml_content = f.read()

result = client.validate(xml_content, version="4.3", profile="AudioAlbum")

if result.valid:
    print("✅ Validation passed!")
else:
    print(f"❌ Found {len(result.errors)} errors:")
    for error in result.errors[:5]:
        print(f"  Line {error.line}: {error.message}")
```

## New v1.0.2 Features

### Auto-Detection and Validation

```python
# Automatically detect version and profile
result = client.validator.validate_auto(xml_content)

# Just detect without validating
version = client.validator.detect_version(xml_content)
profile = client.validator.detect_profile(xml_content)

# Extract metadata
metadata = client.validator.extract_metadata(xml_content)
print(f"Message ID: {metadata['message_id']}")
print(f"Release Count: {metadata['release_count']}")
```

### Batch Processing with Concurrency

```python
from pathlib import Path

# Validate multiple files concurrently
xml_files = list(Path("releases").glob("*.xml"))

batch_result = client.validator.validate_batch(
    files=xml_files,
    version="4.3",
    profile="AudioAlbum",
    max_workers=8  # Process 8 files concurrently
)

print(f"Validated {batch_result.total_files} files in {batch_result.processing_time:.2f}s")
print(f"Valid: {batch_result.valid_files}, Invalid: {batch_result.invalid_files}")
```

### SVRL Report Generation

```python
# Generate SVRL (Schematron Validation Report Language) report
result, svrl = client.validate_with_svrl(
    content=xml_content,
    version="4.3",
    profile="AudioAlbum"
)

if svrl:
    with open("validation-report.svrl", "w") as f:
        f.write(svrl)
    print("SVRL report saved")

# Or use validation options
from ddex_workbench import ValidationOptions

options = ValidationOptions(
    generate_svrl=True,
    verbose=True,
    include_passed_rules=True
)

result = client.validate(xml_content, version="4.3", options=options)
```

### Profile Compliance Reporting

```python
# Get detailed compliance report
summary = client.validator.get_profile_compliance(
    content=xml_content,
    version="4.3",
    profile="AudioAlbum"
)

print(f"Compliance Rate: {summary.pass_rate:.1%}")
print(f"Passed Rules: {summary.passed_rules}/{summary.total_rules}")
print(f"Schematron Errors: {summary.schematron_errors}")
print(f"XSD Errors: {summary.xsd_errors}")
print(f"Business Rule Errors: {summary.business_rule_errors}")
```

### Enhanced Error Filtering and Analysis

```python
# Filter errors by type
schematron_errors = client.validator.get_schematron_errors(result)
xsd_errors = client.validator.get_xsd_errors(result)
business_errors = client.validator.get_business_rule_errors(result)
critical_errors = client.validator.get_critical_errors(xml_content, "4.3")

# Format errors with grouping
formatted = client.validator.format_errors(
    result,
    group_by_rule=True,
    include_context=True,
    max_per_group=5
)
print(formatted)

# Generate comprehensive summary
summary_text = client.validator.generate_summary(result)
print(summary_text)
```

### URL and File Validation

```python
# Validate from URL
result = client.validator.validate_url(
    url="https://example.com/release.xml",
    version="4.3",
    profile="AudioAlbum"
)

# Validate file with hash generation
result = client.validator.validate_file(
    filepath=Path("release.xml"),
    version="4.3",
    generate_hash=True  # Adds MD5 and SHA256 to metadata
)

print(f"File hash: {result.metadata['file_hash_sha256']}")
```

## Usage Examples

### Basic Validation

```python
from ddex_workbench import DDEXClient

client = DDEXClient()

# Validate with specific version
result = client.validate(xml_content, version="4.3")

# Validate with profile
result = client.validate(xml_content, version="4.3", profile="AudioAlbum")

# Check validation status
if result.valid:
    print("Validation passed!")
else:
    print(f"Errors: {len(result.errors)}")
    print(f"Warnings: {len(result.warnings)}")
```

### Advanced Validation Options

```python
from ddex_workbench import DDEXClient, ValidationOptions

client = DDEXClient()

# Configure validation options
options = ValidationOptions(
    generate_svrl=True,           # Generate SVRL report
    verbose=True,                  # Include detailed information
    include_passed_rules=True,     # Show which rules passed
    max_errors=100                 # Limit number of errors
)

result = client.validate(
    content=xml_content,
    version="4.3",
    profile="AudioAlbum",
    options=options
)

# Access additional information
if result.passed_rules:
    print(f"Passed {len(result.passed_rules)} rules")

if result.svrl:
    print("SVRL report generated")
```

### Dynamic API Key Management

```python
client = DDEXClient()

# Set API key dynamically
client.set_api_key("ddex_your-api-key")

# Update API key
client.set_api_key("ddex_new-api-key")

# Clear API key (use anonymous mode)
client.clear_api_key()

# Get current configuration
config = client.get_config()
print(f"Base URL: {config['base_url']}")
print(f"Timeout: {config['timeout']}s")
```

### Error Handling

```python
from ddex_workbench import (
    DDEXClient,
    RateLimitError,
    ValidationError,
    AuthenticationError,
    ParseError,
    FileError,
    NetworkError
)

client = DDEXClient()

try:
    result = client.validate(xml_content, version="4.3")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
    print(e.get_retry_message())
except AuthenticationError:
    print("Invalid API key")
except ParseError as e:
    print(f"XML parsing error at {e.get_location()}: {e.message}")
except FileError as e:
    print(f"File error: {e.message}")
    if e.filepath:
        print(f"File: {e.filepath}")
except NetworkError as e:
    print(f"Network error: {e.message}")
    if e.can_retry:
        print(e.get_retry_message())
except ValidationError as e:
    print(f"Validation failed: {e.get_summary()}")
except DDEXError as e:
    print(f"DDEX error: {e}")
```

### Health Check and Status

```python
# Check API health
health = client.health()
print(f"API Status: {health.status}")
print(f"Version: {health.version}")
print(f"Timestamp: {health.timestamp}")

# Get supported formats
formats = client.formats()
print(f"Supported formats: {formats.formats}")
print(f"ERN versions: {formats.versions}")
print(f"Profiles: {formats.profiles}")
```

### Context Manager

```python
# Automatic session cleanup
with DDEXClient(api_key="ddex_key") as client:
    result = client.validate(xml_content, version="4.3")
    # Session automatically closed after block
```

## Command Line Interface

```bash
# Validate a file
ddex-validate release.xml --version 4.3 --profile AudioAlbum

# Auto-detect version
ddex-validate release.xml --auto

# Validate with SVRL generation
ddex-validate release.xml --version 4.3 --svrl report.svrl

# Batch validate directory
ddex-validate releases/ --version 4.3 --recursive --workers 8

# Generate compliance report
ddex-validate release.xml --version 4.3 --profile AudioAlbum --compliance
```

## Configuration

```python
from ddex_workbench import DDEXClient

# Full configuration
client = DDEXClient(
    api_key="ddex_your-api-key",           # Optional API key
    base_url="https://api.ddex-workbench.org/v1",  # API endpoint
    timeout=30,                             # Request timeout in seconds
    max_retries=3,                          # Max retry attempts
    retry_delay=1.0,                        # Initial retry delay
    verify_ssl=True                         # SSL verification
)
```

## Supported Versions and Profiles

### ERN Versions
- **ERN 4.3** (Recommended)
- **ERN 4.2**
- **ERN 3.8.2**

### Profiles by Version

**ERN 4.3 & 4.2:**
- AudioAlbum
- AudioSingle
- Video
- Mixed
- Classical
- Ringtone
- DJ

**ERN 3.8.2:**
- All above profiles plus:
- ReleaseByRelease

## Requirements

- Python 3.7+
- requests 2.28+
- urllib3 1.26+

## Development

```bash
# Clone repository
git clone https://github.com/daddykev/ddex-workbench.git
cd ddex-workbench/packages/python-sdk

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run tests with coverage
pytest --cov=ddex_workbench --cov-report=html

# Run linting
flake8 ddex_workbench
black --check ddex_workbench
mypy ddex_workbench

# Format code
black ddex_workbench
isort ddex_workbench
```

## CI/CD Integration

```python
# example_ci.py
from ddex_workbench import DDEXClient
from pathlib import Path
import sys

client = DDEXClient()

# Validate all releases
releases = Path("releases").glob("*.xml")
all_valid = True

for release_file in releases:
    result = client.validator.validate_file(release_file, version="4.3")
    
    if not result.valid:
        all_valid = False
        print(f"❌ {release_file.name}: {len(result.errors)} errors")
        
        # Show first 3 errors
        for error in result.errors[:3]:
            print(f"  Line {error.line}: {error.message}")
    else:
        print(f"✅ {release_file.name}: Valid")

# Exit with appropriate code
sys.exit(0 if all_valid else 1)
```

## Testing

```bash
# Run all tests
pytest

# Run specific test file
pytest tests/test_client.py

# Run integration tests
pytest tests/integration/

# Run with coverage
pytest --cov=ddex_workbench --cov-report=html

# Run tests in parallel
pytest -n auto
```

## Documentation

- 📚 [Full Documentation](https://ddex-workbench.org/docs)
- 🌐 [API Reference](https://ddex-workbench.org/api)
- 📖 [DDEX Standards](https://kb.ddex.net)

## Contributing

We welcome contributions! Please see our [Contributing Guide](https://github.com/daddykev/ddex-workbench/blob/main/CONTRIBUTING.md) for details.

### Quick Start for Contributors
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes with tests
4. Run the test suite (`pytest`)
5. Commit your changes (`git commit -m 'Add amazing feature'`)
6. Push to the branch (`git push origin feature/amazing-feature`)
7. Open a Pull Request

## Support

- 💬 [GitHub Issues](https://github.com/daddykev/ddex-workbench/issues) - Bug reports and feature requests
- 📧 [Email Support](mailto:support@ddex-workbench.org) - Direct support
- 🌐 [Website](https://ddex-workbench.org) - Web application
- 📚 [Documentation](https://ddex-workbench.org/docs) - Full documentation

## License

MIT License - see [LICENSE](LICENSE) for details.

## Related Projects

- [DDEX Workbench Web App](https://ddex-workbench.org) - Web-based validation interface
- [@ddex-workbench/sdk](https://www.npmjs.com/package/@ddex-workbench/sdk) - JavaScript/TypeScript SDK
- [DDEX Knowledge Base](https://kb.ddex.net) - Official DDEX documentation

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for a detailed version history.

### Recent Updates (v1.0.2)
- ✅ Schematron validation support
- ✅ SVRL report generation
- ✅ Auto-detection of version and profile
- ✅ Batch processing with concurrency
- ✅ URL and file validation methods
- ✅ Profile compliance reporting
- ✅ Enhanced error filtering
- ✅ Dynamic API key management

## Acknowledgments

Built with ❤️ for the music industry by the DDEX Workbench team.

Special thanks to:
- The DDEX organization for maintaining industry standards
- The music technology community for feedback and support
- All contributors who help make DDEX more accessible

---

**DDEX Workbench** - Making DDEX validation simple, fast, and reliable.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/daddykev/ddex-workbench",
    "name": "ddex-workbench",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "ddex, ern, music, metadata, validation, xml, music-industry, sdk",
    "author": "DDEX Workbench Contributors",
    "author_email": "DDEX Workbench Contributors <support@ddex-workbench.org>",
    "download_url": "https://files.pythonhosted.org/packages/7e/14/b5f442560f97f89f565a30826c9da124e1a45fb655f1cdeeb226264d749b/ddex_workbench-1.0.2.tar.gz",
    "platform": null,
    "description": "# DDEX Workbench Python SDK\n\n[![PyPI version](https://img.shields.io/pypi/v/ddex-workbench.svg)](https://pypi.org/project/ddex-workbench/)\n[![Python versions](https://img.shields.io/pypi/pyversions/ddex-workbench.svg)](https://pypi.org/project/ddex-workbench/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://ddex-workbench.org/docs)\n\nOfficial Python SDK for [DDEX Workbench](https://ddex-workbench.org) - Open-source DDEX validation and processing tools for the music industry.\n\n## \ud83c\udf89 New in Version 1.0.2\n\n- **Enhanced Schematron Rules**: Comprehensive business rule validation with meaningful, actionable SVRL reports\n- **SVRL Report Generation**: Generate detailed validation reports in Schematron Validation Report Language format\n- **Auto-Detection**: Automatically detect ERN version and profile from XML content\n- **Concurrent Batch Processing**: Validate multiple files in parallel with configurable worker pools\n- **URL and File Validation**: Validate XML directly from URLs or files with optional hash generation\n- **Advanced Error Filtering**: Separate and analyze errors by type (Schematron, XSD, Business Rules)\n- **Profile Compliance Reports**: Get detailed compliance statistics with pass/fail rates\n- **Metadata Extraction**: Extract message IDs, creation dates, and release counts from XML\n- **Enhanced Error Classes**: Specialized error handling for parsing, files, configuration, and API errors\n- **Dynamic API Key Management**: Update or clear API keys without recreating client\n\nSee [CHANGELOG.md](CHANGELOG.md) for full details.\n\n## Features\n\n- \ud83d\ude80 **Simple API** - Intuitive methods for all DDEX validation operations\n- \ud83d\udd27 **Full Type Safety** - Type hints, dataclasses, and IDE autocomplete support\n- \ud83c\udf10 **Smart Networking** - Connection pooling, retry logic, and timeout handling\n- \ud83d\udcca **Flexible Validation** - Support for ERN 3.8.2, 4.2, and 4.3 with all profiles\n- \ud83c\udfaf **Comprehensive Error Reporting** - Detailed errors with line numbers, context, and suggestions\n- \ud83d\udcc8 **Multiple Report Formats** - JSON, CSV, text, and SVRL output formats\n- \ud83d\udd11 **Authentication Support** - API key management for higher rate limits\n- \u26a1 **High Performance** - Efficient XML processing and parallel batch operations\n- \ud83d\udee1\ufe0f **Robust Error Handling** - Specialized exception classes for different error scenarios\n- \ud83d\udce6 **Zero Configuration** - Works out of the box with sensible defaults\n\n## Installation\n\n```bash\npip install ddex-workbench\n```\n\nFor development:\n```bash\npip install ddex-workbench[dev]\n```\n\n## Quick Start\n\n```python\nfrom ddex_workbench import DDEXClient\n\n# Initialize client (API key optional for higher rate limits)\nclient = DDEXClient(api_key=\"ddex_your-api-key\")\n\n# Validate ERN XML\nwith open(\"release.xml\", \"r\") as f:\n    xml_content = f.read()\n\nresult = client.validate(xml_content, version=\"4.3\", profile=\"AudioAlbum\")\n\nif result.valid:\n    print(\"\u2705 Validation passed!\")\nelse:\n    print(f\"\u274c Found {len(result.errors)} errors:\")\n    for error in result.errors[:5]:\n        print(f\"  Line {error.line}: {error.message}\")\n```\n\n## New v1.0.2 Features\n\n### Auto-Detection and Validation\n\n```python\n# Automatically detect version and profile\nresult = client.validator.validate_auto(xml_content)\n\n# Just detect without validating\nversion = client.validator.detect_version(xml_content)\nprofile = client.validator.detect_profile(xml_content)\n\n# Extract metadata\nmetadata = client.validator.extract_metadata(xml_content)\nprint(f\"Message ID: {metadata['message_id']}\")\nprint(f\"Release Count: {metadata['release_count']}\")\n```\n\n### Batch Processing with Concurrency\n\n```python\nfrom pathlib import Path\n\n# Validate multiple files concurrently\nxml_files = list(Path(\"releases\").glob(\"*.xml\"))\n\nbatch_result = client.validator.validate_batch(\n    files=xml_files,\n    version=\"4.3\",\n    profile=\"AudioAlbum\",\n    max_workers=8  # Process 8 files concurrently\n)\n\nprint(f\"Validated {batch_result.total_files} files in {batch_result.processing_time:.2f}s\")\nprint(f\"Valid: {batch_result.valid_files}, Invalid: {batch_result.invalid_files}\")\n```\n\n### SVRL Report Generation\n\n```python\n# Generate SVRL (Schematron Validation Report Language) report\nresult, svrl = client.validate_with_svrl(\n    content=xml_content,\n    version=\"4.3\",\n    profile=\"AudioAlbum\"\n)\n\nif svrl:\n    with open(\"validation-report.svrl\", \"w\") as f:\n        f.write(svrl)\n    print(\"SVRL report saved\")\n\n# Or use validation options\nfrom ddex_workbench import ValidationOptions\n\noptions = ValidationOptions(\n    generate_svrl=True,\n    verbose=True,\n    include_passed_rules=True\n)\n\nresult = client.validate(xml_content, version=\"4.3\", options=options)\n```\n\n### Profile Compliance Reporting\n\n```python\n# Get detailed compliance report\nsummary = client.validator.get_profile_compliance(\n    content=xml_content,\n    version=\"4.3\",\n    profile=\"AudioAlbum\"\n)\n\nprint(f\"Compliance Rate: {summary.pass_rate:.1%}\")\nprint(f\"Passed Rules: {summary.passed_rules}/{summary.total_rules}\")\nprint(f\"Schematron Errors: {summary.schematron_errors}\")\nprint(f\"XSD Errors: {summary.xsd_errors}\")\nprint(f\"Business Rule Errors: {summary.business_rule_errors}\")\n```\n\n### Enhanced Error Filtering and Analysis\n\n```python\n# Filter errors by type\nschematron_errors = client.validator.get_schematron_errors(result)\nxsd_errors = client.validator.get_xsd_errors(result)\nbusiness_errors = client.validator.get_business_rule_errors(result)\ncritical_errors = client.validator.get_critical_errors(xml_content, \"4.3\")\n\n# Format errors with grouping\nformatted = client.validator.format_errors(\n    result,\n    group_by_rule=True,\n    include_context=True,\n    max_per_group=5\n)\nprint(formatted)\n\n# Generate comprehensive summary\nsummary_text = client.validator.generate_summary(result)\nprint(summary_text)\n```\n\n### URL and File Validation\n\n```python\n# Validate from URL\nresult = client.validator.validate_url(\n    url=\"https://example.com/release.xml\",\n    version=\"4.3\",\n    profile=\"AudioAlbum\"\n)\n\n# Validate file with hash generation\nresult = client.validator.validate_file(\n    filepath=Path(\"release.xml\"),\n    version=\"4.3\",\n    generate_hash=True  # Adds MD5 and SHA256 to metadata\n)\n\nprint(f\"File hash: {result.metadata['file_hash_sha256']}\")\n```\n\n## Usage Examples\n\n### Basic Validation\n\n```python\nfrom ddex_workbench import DDEXClient\n\nclient = DDEXClient()\n\n# Validate with specific version\nresult = client.validate(xml_content, version=\"4.3\")\n\n# Validate with profile\nresult = client.validate(xml_content, version=\"4.3\", profile=\"AudioAlbum\")\n\n# Check validation status\nif result.valid:\n    print(\"Validation passed!\")\nelse:\n    print(f\"Errors: {len(result.errors)}\")\n    print(f\"Warnings: {len(result.warnings)}\")\n```\n\n### Advanced Validation Options\n\n```python\nfrom ddex_workbench import DDEXClient, ValidationOptions\n\nclient = DDEXClient()\n\n# Configure validation options\noptions = ValidationOptions(\n    generate_svrl=True,           # Generate SVRL report\n    verbose=True,                  # Include detailed information\n    include_passed_rules=True,     # Show which rules passed\n    max_errors=100                 # Limit number of errors\n)\n\nresult = client.validate(\n    content=xml_content,\n    version=\"4.3\",\n    profile=\"AudioAlbum\",\n    options=options\n)\n\n# Access additional information\nif result.passed_rules:\n    print(f\"Passed {len(result.passed_rules)} rules\")\n\nif result.svrl:\n    print(\"SVRL report generated\")\n```\n\n### Dynamic API Key Management\n\n```python\nclient = DDEXClient()\n\n# Set API key dynamically\nclient.set_api_key(\"ddex_your-api-key\")\n\n# Update API key\nclient.set_api_key(\"ddex_new-api-key\")\n\n# Clear API key (use anonymous mode)\nclient.clear_api_key()\n\n# Get current configuration\nconfig = client.get_config()\nprint(f\"Base URL: {config['base_url']}\")\nprint(f\"Timeout: {config['timeout']}s\")\n```\n\n### Error Handling\n\n```python\nfrom ddex_workbench import (\n    DDEXClient,\n    RateLimitError,\n    ValidationError,\n    AuthenticationError,\n    ParseError,\n    FileError,\n    NetworkError\n)\n\nclient = DDEXClient()\n\ntry:\n    result = client.validate(xml_content, version=\"4.3\")\nexcept RateLimitError as e:\n    print(f\"Rate limited. Retry after {e.retry_after} seconds\")\n    print(e.get_retry_message())\nexcept AuthenticationError:\n    print(\"Invalid API key\")\nexcept ParseError as e:\n    print(f\"XML parsing error at {e.get_location()}: {e.message}\")\nexcept FileError as e:\n    print(f\"File error: {e.message}\")\n    if e.filepath:\n        print(f\"File: {e.filepath}\")\nexcept NetworkError as e:\n    print(f\"Network error: {e.message}\")\n    if e.can_retry:\n        print(e.get_retry_message())\nexcept ValidationError as e:\n    print(f\"Validation failed: {e.get_summary()}\")\nexcept DDEXError as e:\n    print(f\"DDEX error: {e}\")\n```\n\n### Health Check and Status\n\n```python\n# Check API health\nhealth = client.health()\nprint(f\"API Status: {health.status}\")\nprint(f\"Version: {health.version}\")\nprint(f\"Timestamp: {health.timestamp}\")\n\n# Get supported formats\nformats = client.formats()\nprint(f\"Supported formats: {formats.formats}\")\nprint(f\"ERN versions: {formats.versions}\")\nprint(f\"Profiles: {formats.profiles}\")\n```\n\n### Context Manager\n\n```python\n# Automatic session cleanup\nwith DDEXClient(api_key=\"ddex_key\") as client:\n    result = client.validate(xml_content, version=\"4.3\")\n    # Session automatically closed after block\n```\n\n## Command Line Interface\n\n```bash\n# Validate a file\nddex-validate release.xml --version 4.3 --profile AudioAlbum\n\n# Auto-detect version\nddex-validate release.xml --auto\n\n# Validate with SVRL generation\nddex-validate release.xml --version 4.3 --svrl report.svrl\n\n# Batch validate directory\nddex-validate releases/ --version 4.3 --recursive --workers 8\n\n# Generate compliance report\nddex-validate release.xml --version 4.3 --profile AudioAlbum --compliance\n```\n\n## Configuration\n\n```python\nfrom ddex_workbench import DDEXClient\n\n# Full configuration\nclient = DDEXClient(\n    api_key=\"ddex_your-api-key\",           # Optional API key\n    base_url=\"https://api.ddex-workbench.org/v1\",  # API endpoint\n    timeout=30,                             # Request timeout in seconds\n    max_retries=3,                          # Max retry attempts\n    retry_delay=1.0,                        # Initial retry delay\n    verify_ssl=True                         # SSL verification\n)\n```\n\n## Supported Versions and Profiles\n\n### ERN Versions\n- **ERN 4.3** (Recommended)\n- **ERN 4.2**\n- **ERN 3.8.2**\n\n### Profiles by Version\n\n**ERN 4.3 & 4.2:**\n- AudioAlbum\n- AudioSingle\n- Video\n- Mixed\n- Classical\n- Ringtone\n- DJ\n\n**ERN 3.8.2:**\n- All above profiles plus:\n- ReleaseByRelease\n\n## Requirements\n\n- Python 3.7+\n- requests 2.28+\n- urllib3 1.26+\n\n## Development\n\n```bash\n# Clone repository\ngit clone https://github.com/daddykev/ddex-workbench.git\ncd ddex-workbench/packages/python-sdk\n\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Run tests with coverage\npytest --cov=ddex_workbench --cov-report=html\n\n# Run linting\nflake8 ddex_workbench\nblack --check ddex_workbench\nmypy ddex_workbench\n\n# Format code\nblack ddex_workbench\nisort ddex_workbench\n```\n\n## CI/CD Integration\n\n```python\n# example_ci.py\nfrom ddex_workbench import DDEXClient\nfrom pathlib import Path\nimport sys\n\nclient = DDEXClient()\n\n# Validate all releases\nreleases = Path(\"releases\").glob(\"*.xml\")\nall_valid = True\n\nfor release_file in releases:\n    result = client.validator.validate_file(release_file, version=\"4.3\")\n    \n    if not result.valid:\n        all_valid = False\n        print(f\"\u274c {release_file.name}: {len(result.errors)} errors\")\n        \n        # Show first 3 errors\n        for error in result.errors[:3]:\n            print(f\"  Line {error.line}: {error.message}\")\n    else:\n        print(f\"\u2705 {release_file.name}: Valid\")\n\n# Exit with appropriate code\nsys.exit(0 if all_valid else 1)\n```\n\n## Testing\n\n```bash\n# Run all tests\npytest\n\n# Run specific test file\npytest tests/test_client.py\n\n# Run integration tests\npytest tests/integration/\n\n# Run with coverage\npytest --cov=ddex_workbench --cov-report=html\n\n# Run tests in parallel\npytest -n auto\n```\n\n## Documentation\n\n- \ud83d\udcda [Full Documentation](https://ddex-workbench.org/docs)\n- \ud83c\udf10 [API Reference](https://ddex-workbench.org/api)\n- \ud83d\udcd6 [DDEX Standards](https://kb.ddex.net)\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](https://github.com/daddykev/ddex-workbench/blob/main/CONTRIBUTING.md) for details.\n\n### Quick Start for Contributors\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes with tests\n4. Run the test suite (`pytest`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## Support\n\n- \ud83d\udcac [GitHub Issues](https://github.com/daddykev/ddex-workbench/issues) - Bug reports and feature requests\n- \ud83d\udce7 [Email Support](mailto:support@ddex-workbench.org) - Direct support\n- \ud83c\udf10 [Website](https://ddex-workbench.org) - Web application\n- \ud83d\udcda [Documentation](https://ddex-workbench.org/docs) - Full documentation\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Related Projects\n\n- [DDEX Workbench Web App](https://ddex-workbench.org) - Web-based validation interface\n- [@ddex-workbench/sdk](https://www.npmjs.com/package/@ddex-workbench/sdk) - JavaScript/TypeScript SDK\n- [DDEX Knowledge Base](https://kb.ddex.net) - Official DDEX documentation\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a detailed version history.\n\n### Recent Updates (v1.0.2)\n- \u2705 Schematron validation support\n- \u2705 SVRL report generation\n- \u2705 Auto-detection of version and profile\n- \u2705 Batch processing with concurrency\n- \u2705 URL and file validation methods\n- \u2705 Profile compliance reporting\n- \u2705 Enhanced error filtering\n- \u2705 Dynamic API key management\n\n## Acknowledgments\n\nBuilt with \u2764\ufe0f for the music industry by the DDEX Workbench team.\n\nSpecial thanks to:\n- The DDEX organization for maintaining industry standards\n- The music technology community for feedback and support\n- All contributors who help make DDEX more accessible\n\n---\n\n**DDEX Workbench** - Making DDEX validation simple, fast, and reliable.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Official Python SDK for DDEX Workbench - Open-source DDEX validation tools",
    "version": "1.0.2",
    "project_urls": {
        "Documentation": "https://ddex-workbench.org/docs",
        "Homepage": "https://ddex-workbench.org",
        "Issues": "https://github.com/daddykev/ddex-workbench/issues",
        "Repository": "https://github.com/daddykev/ddex-workbench"
    },
    "split_keywords": [
        "ddex",
        " ern",
        " music",
        " metadata",
        " validation",
        " xml",
        " music-industry",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8ddefe90624456abaad6c5adad2b5bd1c64ec1d5e594be436c16900bb92ae149",
                "md5": "ea875c55faf5995622b110dbfe2e4050",
                "sha256": "d0e53f2f899c7ab4e77aa0e854f6b1a1345b27a0526271b43deb137e236b3066"
            },
            "downloads": -1,
            "filename": "ddex_workbench-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ea875c55faf5995622b110dbfe2e4050",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 24806,
            "upload_time": "2025-09-04T02:43:38",
            "upload_time_iso_8601": "2025-09-04T02:43:38.646801Z",
            "url": "https://files.pythonhosted.org/packages/8d/de/fe90624456abaad6c5adad2b5bd1c64ec1d5e594be436c16900bb92ae149/ddex_workbench-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7e14b5f442560f97f89f565a30826c9da124e1a45fb655f1cdeeb226264d749b",
                "md5": "a3113aff1db4c536da9409123784936a",
                "sha256": "91c139f2de50e4a47bdc9f9d86f5adfb4609770a9aa8f221d2c8f66001062620"
            },
            "downloads": -1,
            "filename": "ddex_workbench-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a3113aff1db4c536da9409123784936a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 38809,
            "upload_time": "2025-09-04T02:43:40",
            "upload_time_iso_8601": "2025-09-04T02:43:40.589868Z",
            "url": "https://files.pythonhosted.org/packages/7e/14/b5f442560f97f89f565a30826c9da124e1a45fb655f1cdeeb226264d749b/ddex_workbench-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-04 02:43:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "daddykev",
    "github_project": "ddex-workbench",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ddex-workbench"
}
        
Elapsed time: 1.27959s