Key Changes: - Updated metadata_extractor_mvp.py to use SIMPLE structure for all tabular fields - All tabular fields now use direct value objects (no MetadataTableFieldRow wrapper) - MAIN_LANGUAGES, ASSETCOMPLIANCE, MARKETING_TAG, CREATIVEX all use SIMPLE structure - Master Asset ID field updated to SIMPLE structure - Date fields now use type 'string' instead of 'long' - Matches DAM reference structure from asset_representation.json Added Files: - metadata_extractor_mvp_PROD.py: PROD-specific version with same SIMPLE structure - Backup files for safety - Analysis and comparison documentation Environment: - Tested and working in PPR environment (ppr.dam.ferrero.com) - All tabular fields match DAM-supplied reference structure - Successful uploads confirmed Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
39 lines
1.1 KiB
Python
Executable file
39 lines
1.1 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
"""List all campaigns grouped by status"""
|
|
import sys
|
|
import os
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
|
|
|
from shared.config_loader import load_config
|
|
from shared.dam_client import DAMClient
|
|
|
|
config = load_config('config/config.yaml')
|
|
dam = DAMClient(config)
|
|
|
|
print("\n" + "="*70)
|
|
print("Fetching all Local Adaptation campaigns...")
|
|
print("="*70)
|
|
|
|
campaigns = dam.search_campaigns(status=None, campaign_type='Local Adaptation')
|
|
|
|
# Group by status
|
|
by_status = {}
|
|
for c in campaigns:
|
|
status = c.get('status', 'NO STATUS')
|
|
if status not in by_status:
|
|
by_status[status] = []
|
|
by_status[status].append(c)
|
|
|
|
print("\nCampaigns by Status:")
|
|
print("-" * 70)
|
|
for status in sorted(by_status.keys()):
|
|
count = len(by_status[status])
|
|
print(f"\n{status}: {count} campaign(s)")
|
|
for c in by_status[status][:3]: # Show first 3
|
|
print(f" - {c.get('campaign_name', 'Unknown')} (ID: {c.get('campaign_id', 'N/A')})")
|
|
if count > 3:
|
|
print(f" ... and {count - 3} more")
|
|
|
|
print("\n" + "="*70)
|
|
print(f"Total campaigns: {len(campaigns)}")
|
|
print("="*70 + "\n")
|