Скрипт не принимает excel файлы и работает только с БД (диапазоны дат лидов можно настроить в таблице mySQL "call_calculation"). Покажет насколько быстро сотрудники колл-центра или ТТ отвечают на звонки клиентов и перезванивают ли.
Python tool for analyzing customer callback speed and employee response time using SQL call data.
This project analyzes customer callback speed and employee response time using SQL call history data.
The tool supports two analysis modes:
- Database analysis mode — analyzes callback performance directly from SQL data.
- Excel file mode — validates a custom list of customer requests from Excel files and checks callback results for each record.
The script matches customer requests with incoming and outgoing calls and evaluates whether employees contacted customers within the required SLA time.
The main objective is to monitor customer service quality and measure response time performance.
The analysis helps answer:
- Was the customer contacted?
- How quickly did the employee call back?
- Was the callback completed within SLA?
- Did the customer call again before receiving a callback?
- SQL database connection
- Excel file processing
- Call history extraction
- Phone number cleaning and normalization
- Incoming and outgoing call matching
- Callback time calculation
- SLA compliance analysis
- Multiple analysis modes:
- full database callback analysis
- Excel-based customer list validation
- Automatic Excel report generation
- Telegram execution notifications
- Python
- pandas
- SQLAlchemy
- PyMySQL
- pyTelegramBotAPI
- tqdm
- openpyxl
- python-dotenv
- Loads call history from SQL database
- Processes incoming and outgoing calls
- Matches customer requests with employee callbacks
- Calculates callback response time
- Checks SLA compliance
- Generates analytics report
- Loads customer request list from Excel
- Extracts relevant calls from SQL database
- Filters calls by phone number and request date
- Searches for the first outgoing callback
- Checks if callback was completed within 15 minutes
- Determines customer behavior:
- employee called back on time
- employee called back late
- customer called again before callback
- no callback detected
- Adds analysis results into the Excel file
Database mode:
- Call history database
- Incoming calls
- Outgoing calls
- Call timestamps
Excel file mode:
Excel file containing:
- Customer phone number
- Request creation datetime
Generated report containing:
- First outgoing call time
- First incoming call time
- Callback status
- SLA result
- Response time classification