Commit graph

4 commits

Author SHA1 Message Date
nickviljoen
04eccab9e7 Enhancement: Add environment-specific configurations and metadata improvements
This commit includes critical updates for PPR deployment:

1. Environment-Specific Field Mappings:
   - Created field_mappings_ppr.yaml with agency code "Oliver"
   - Created field_mappings_prod.yaml with agency code "0000221659"
   - Updated config_loader.py to auto-detect environment based on DAM URL
   - Enables seamless deployment between PPR and PROD environments

2. Metadata Extractor Enhancements:
   - Added MetadataTable extraction support for nested fields
   - Enables extraction of "Type of Video & Static Right" multi-value field
   - Added logic to apply defaults to existing but empty fields
   - Fixed agency name display_value handling for domain fields

3. Default Values Added:
   - VIDEO_POST_PROD_COMPANY: "Oliver Marketing Ltd"
   - AUDIO_POST_PROD_COMPANY: "Oliver Marketing Ltd"
   - PROD_COMPANY (Production House): "-"

These changes ensure:
- Correct agency codes per environment (PPR/PROD)
- Proper extraction of nested tabular fields
- Default values for empty production company fields
- Seamless deployment workflow

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 20:41:21 +02:00
DJP
37cab9d902 Add support for loading environment-specific .env files (prod/dev) 2025-11-26 15:44:09 -05:00
DJP
d5c71b4c45 Add country code mapping system (ISO -> DAM codes)
- Created config/country_code_mappings.yaml with 165 country mappings
- ISO codes (used in filenames) now map to DAM-specific codes
- Codes under review set to XX as placeholder
- Added load_country_code_mappings() to config_loader.py
- Updated MetadataExtractorMVP to load and apply country mappings
- Added _map_country_code() and _get_field_value() helper methods
- Country mapping applies in both full and folder-only modes

Key mappings:
- BD (Bangladesh) -> BG (DAM code, though appears incorrect)
- DE (Germany) -> DE (same)
- IT (Italy) -> IT (same)
- Most codes under review -> XX (placeholder)

Mapping file can be edited without code changes - updates apply automatically

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 19:15:26 -05:00
DJP
9dc272f8bf Start Python automation - Foundation components
Created Python-Version/ directory structure:
 Complete folder hierarchy (scripts, config, logs, temp, tests)
 Virtual environment setup script
 Python 3.6+ compatible dependencies
 Configuration system with env var substitution
 DAM API client (complete)

Components Implemented:
1. setup.sh - venv creation and dependency installation
2. requirements.txt - Python 3.6/3.10 compatible packages
3. config/config.yaml - Main configuration (URLs, credentials, settings)
4. config/field_mappings.yaml - MVP fields list (easy to edit!)
5. config_loader.py - YAML config with ${VAR} substitution
6. dam_client.py - Complete DAM API wrapper:
   - OAuth2 with auto-refresh
   - search_campaigns(status)
   - get_master_assets(campaign_id)
   - download_asset(asset_id)
   - upload_asset() with video metadata
   - update_campaign_status()
   - Helper methods

Features:
- Python 3.6 compatible (shared hosting requirement)
- Python 3.10 compatible (local development)
- Configuration-driven (no hardcoded values)
- Environment-specific configs (staging/production)
- Comprehensive error handling
- Logging built-in

Next: Box client, Database client, FilenameParser, MetadataExtractorMVP,
      Notifier, then main scripts (A1→A2, A2→A3)

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 16:38:26 -04:00