Commit graph

2 commits

Author SHA1 Message Date
DJP
b4e004c822 Complete Python automation implementation - All components built
MAJOR MILESTONE: Complete Python automation system created!

Components Implemented:
 Box Client (box_client.py)
   - JWT authentication via boxsdk
   - Upload with tracking ID suffix
   - Download files
   - Campaign folder creation
   - Connection testing

 Database Client (database.py)
   - PostgreSQL connection pooling
   - generate_unique_tracking_id()
   - store_master_asset() with full_metadata JSONB
   - get_master_asset(tracking_id)
   - check_campaign_upload_complete() - ALL-DONE CHECK!
   - store_derivative_asset()
   - Connection testing

 Filename Parser (filename_parser.py)
   - V2 naming convention parser (ported from PHP)
   - parse_filename() - 10 components
   - strip_upload_components() - Remove Job# and Tracking ID
   - Strict validation with detailed errors

 Metadata Extractor MVP (metadata_extractor_mvp.py)
   - Extract 28 MVP fields from master
   - Update fields from V2 filename (Description, Language, State)
   - Add missing fields with defaults
   - Build asset representation for upload

 Notifier (notifier.py)
   - Mailgun email integration
   - Outgoing webhook sender
   - Email templates (success, error, partial, critical)
   - Configurable recipients

Main Scripts:
 A1→A2 Download (a1_to_a2_download.py)
   - Poll DAM every 5 minutes for A1 campaigns
   - Download all master assets
   - Upload to Box with tracking IDs
   - Store in DB with full metadata
   - ALL-DONE CHECK before status update
   - Update A1→A2 only if all assets successful
   - Send webhook with campaign ID/number
   - Email notifications

 A2→A3 Upload (a2_to_a3_upload.py)
   - Flask webhook receiver for Box uploads
   - Signature validation
   - Async task queue processing
   - Parse V2 filenames
   - Load master metadata
   - Extract MVP fields
   - Upload to DAM
   - ALL-DONE CHECK for campaign
   - Update A2→A3 when all assets uploaded
   - Send webhook notifications

 Test Connection Script (test_connection.py)
   - Verify DAM, Box, Database connectivity
   - Quick health check

 README.md
   - Complete setup guide
   - Usage instructions
   - Configuration examples
   - Troubleshooting

Key Features:
- Python 3.6+ compatible (server requirement)
- Virtual environment isolated
- Configuration-driven (YAML files)
- Easy field updates (no code changes)
- Environment switching (staging/production)
- Comprehensive error handling
- Email + webhook notifications
- Retry logic
- All-done checks before status updates
- Campaign webhook notifications

Ready for testing locally with Python 3.10!

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 16:49:14 -04: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