ferrero-opentext/Python-Version/config/config.yaml
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

101 lines
2.3 KiB
YAML

# Ferrero Content Scaling - Main Configuration
# All settings can be overridden by environment-specific configs
# Environment selector (set via ENV environment variable)
environment: ${ENV:-staging}
# DAM Configuration
dam:
base_url: ${DAM_BASE_URL}
auth_url: ${DAM_AUTH_URL}
client_id: ${DAM_CLIENT_ID}
client_secret: ${DAM_CLIENT_SECRET}
timeout_seconds: 120
# Box Configuration
box:
enterprise_id: ${BOX_ENTERPRISE_ID}
client_id: ${BOX_CLIENT_ID}
client_secret: ${BOX_CLIENT_SECRET}
jwt_key_id: ${BOX_JWT_KEY_ID}
rsa_private_key_path: ../Box-config.json
passphrase: ${BOX_PASSPHRASE}
root_folder_id: 348526703108 # Default folder for uploads
webhook_signature_keys:
- ${BOX_WEBHOOK_PRIMARY_KEY}
- ${BOX_WEBHOOK_SECONDARY_KEY}
# Database Configuration
database:
host: ${DB_HOST:-localhost}
port: ${DB_PORT:-5433}
database: ferrero_tracking
user: ${DB_USER}
password: ${DB_PASSWORD}
# Polling Configuration (A1→A2)
polling:
enabled: true
interval_seconds: 300 # 5 minutes
max_campaigns_per_run: 10
# Webhook Configuration (A2→A3 receiver)
webhook_receiver:
enabled: true
host: 0.0.0.0
port: 5000
validate_signatures: true
# Outgoing Webhooks (we call these)
webhooks:
campaign_status_update:
enabled: true
url: ${CAMPAIGN_STATUS_WEBHOOK_URL}
timeout_seconds: 10
retry_on_failure: true
max_retries: 3
auth:
type: bearer
token: ${WEBHOOK_AUTH_TOKEN}
# Retry Configuration
retry:
max_attempts: 3
backoff: exponential # exponential, linear, fixed
initial_delay_seconds: 5
max_delay_seconds: 60
# Notification Configuration
notifications:
enabled: true
mailgun:
api_key: ${MAILGUN_API_KEY}
domain: ${MAILGUN_DOMAIN}
recipients:
success:
- team@ferrero.com
errors:
- admin@ferrero.com
critical:
- oncall@ferrero.com
templates_path: config/email_templates.yaml
# Field Configuration
fields:
mappings_file: config/field_mappings.yaml
# Logging Configuration
logging:
level: INFO
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
file:
directory: logs
max_bytes: 10485760 # 10MB
backup_count: 5
console: true
# Temp File Configuration
temp:
directory: temp/downloads
cleanup_after_hours: 24
max_size_mb: 1000