A Python-based system for managing On-Time In-Full (OTIF) metrics and Quality Inspection (QI) data in supply chain operations. Automates data synchronization between CSV sources, Redshift analytics, and SharePoint, with email scheduling and Slack notifications.
- OTIF Tracking: Monitor on-time and in-full delivery metrics across production statuses
- Quality Inspection Management: Automated QI email scheduling and booking coordination
- SharePoint Sync: Bidirectional data synchronization with permission-level user access control
- Multi-Source Integration: Aggregates data from CSV lists, Redshift SQL, and SharePoint
- Slack Notifications: Automated status updates and completion alerts
- Batch Operations: Efficient processing of large datasets with configurable column mappings
- Python 3.7+
- pandas - Data processing and manipulation
- numpy - Numerical operations
- openpyxl - Excel workbook handling
- slack-sdk - Slack message delivery
- Redshift - Analytics queries (configured via connection parameters)
- SharePoint API - List synchronization
- Python 3.7 or higher
- Access to Redshift analytics database
- SharePoint site with appropriate permissions
- Slack workspace token (optional, for notifications)
- Clone the repository and create a virtual environment:
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Configure your environment variables:
# Create .env file with:
REDSHIFT_HOST=your_redshift_host
REDSHIFT_DATABASE=your_db
REDSHIFT_USER=your_user
REDSHIFT_PASSWORD=your_password
SLACK_BOT_TOKEN=your_slack_token
SHAREPOINT_SITE_URL=your_site_url- Update file paths in the scripts:
- Modify
universal_pathinmain.pyto match your OneDrive/SharePoint directory - Update query paths in
Queries/directory
- Modify
python main.pyThis will:
- Fetch Quality Inspection list from SharePoint
- Query OTIF metrics from Redshift
- Process and manipulate the data
- Sync updated data back to SharePoint with permissions
- Schedule QI booking emails
- Send completion notification to Slack
batch_with_permissions.py- Direct SharePoint batch operationsmanipulate_otif.py- OTIF-specific data filtering and processingqi_bookings.py- Quality Inspection booking management
├── main.py # Main orchestration script
├── Queries/ # SQL query files for Redshift
├── Export/ # Generated export files (gitignored)
├── Pull/ # Downloaded data files (gitignored)
├── Compliance/QI Email Scheduler/ # Email scheduling data (gitignored)
├── Mappings/ # Configuration mappings
└── [Python modules] # Data processing functions
- Hardcoded file paths are user-specific and should be moved to environment configuration
- Large data files (.csv, .xlsx) are excluded from version control
- Set up SharePoint app credentials for production use