A powerful, configuration-driven ETL tool that uses Excel spreadsheets to define data migration rules between databases.
This Excel-Driven ETL Tool simplifies database migration and data transformation processes by using an Excel file as a configuration template. Instead of hard-coding migration logic, users can define source tables, destination schemas, column mappings, and transformation rules directly in an intuitive Excel interface.
- ๐ Excel Configuration: Define ETL processes using familiar Excel spreadsheets
- ๐ Multi-Database Support: Works with PostgreSQL, MySQL, and other SQL databases via SQLAlchemy
- ๐ก๏ธ Secure Connection Management: Database credentials stored in hidden JSON files
- โ Column Validation: Automatic validation of source columns against database schemas
- ๐ Comprehensive Logging: Detailed execution logs for monitoring and debugging
- โฑ๏ธ ETL Timestamp Tracking: Automatic addition of processing timestamps to migrated data
- ๐ฏ Flexible Table Selection: Process specific tables or entire database schemas
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ โ โ โ
โ etl_driver.xlsxโโโโโถโ excel_driven_etl โโโโโถโ Destination DB โ
โ Configuration โ โ Python โ โ โ
โ โ โ Script โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โฒ โ โฒ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโ โ
โ โ secrets.json โ โ
โ โ Credentials โ โ
โ โโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Source Database
- Python 3.7 or higher
- pip package manager
- Access to source and destination databases
pip install pandas sqlalchemy psycopg2-binary openpyxl requests-
Clone or download the project files:
git clone <your-repo-url> cd excel-driven-etl
-
Install dependencies (Not there yet):
pip install -r requirements.txt
-
Configure your databases (see Configuration section below)
Create a secrets.json file with your database connection details:
{
"database_connections": {
"source_db": {
"host": "localhost",
"database": "source_database",
"username": "your_username",
"password": "your_password",
"db_type": "postgresql",
"port": 5432
},
"dest_db": {
"host": "localhost",
"database": "destination_database",
"username": "your_username",
"password": "your_password",
"db_type": "postgresql",
"port": 5432
}
}
}The Excel driver file contains multiple sheets:
| Setting | Value | Description |
|---|---|---|
| source_db_key | source_db | Reference to connection in secrets.json |
| source_schema | public | Source database schema |
| dest_db_key | dest_db | Reference to destination connection |
| dest_schema | etl_schema | Destination database schema |
Each additional sheet represents a table to migrate. Sheet names should match source table names.
Example sheet "users":
| Column_Name | New_Name | Filter |
|---|---|---|
| user_id | id | |
| first_name | fname | |
| last_name | lname | |
| email_address | ||
| created_date |
python excel_driven_etl.pyThe script (eventually will) accept command-line arguments and generates detailed logs:
# Run with specific configuration
python excel_driven_etl.py
# Check logs
tail -f excel_driven_etl.log- ๐ง Initialization: Load configuration and establish database connections
- ๐ Validation: Verify column existence in source tables
- ๐ Processing: Extract data from source, transform as needed
- ๐พ Loading: Insert transformed data into destination tables
- ๐ Logging: Generate comprehensive execution reports
- Automatically validates Excel-defined columns against actual database schemas
- Provides detailed logging of matched and unmatched columns
- Continues processing with valid columns only
- Adds
ETL_DATE_TIME_ZONEtimestamp to all migrated records - Supports column renaming (planned feature)
- Filtering capabilities (planned feature)
- Comprehensive exception handling and logging
- Graceful handling of missing columns or tables
- Connection management and cleanup
excel-driven-etl/
โโโ excel_driven_etl.py # Main ETL script
โโโ etl_driver.xlsx # Excel configuration file
โโโ secrets.json # Database credentials (create this)
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
โโโ excel_driven_etl.log # Execution logs
- Better error handling: There are some additional areas where we vould do error checks and maybe gracefully exit when encountering errors
- Column Renaming: Use
New_Namecolumn for destination column names - Data Filtering: Implement row-level filtering using
Filtercolumn - Table Prefixes/Suffixes: Add configurable table name modifications
- Progress Tracking: Enhanced progress indicators and validation
- Database Permissions: Improved permission handling for destination schemas
- Incremental Loading: Support for delta/incremental data loads
- Data Type Mapping: Automatic data type conversion between databases
- Parameterize the driver file: Add a parameter for the excel file path. Consider changing the log file name to include the excel file name
Connection Errors
- Verify database credentials in
secrets.json - Check network connectivity to database servers
- Ensure proper database permissions
Column Mismatch Errors
- Review Excel column names against actual table schemas
- Check logs for specific unmatched columns
- Verify table names match sheet names exactly
Permission Errors
- Ensure destination database user has CREATE TABLE permissions
- Verify schema exists or user can create schemas
The tool generates comprehensive logs including:
- Execution start/end times
- Connection establishment status
- Column validation results
- Data processing progress
- Error details and stack traces
- Performance metrics
Log file location: excel_driven_etl.log
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Joseph P. Merten
- Created: August 13, 2025
- Email: kc8son@yahoo.com
- GitHub: kc8son
- LinkedIn: Joe Merten
- Built with Pandas for data manipulation
- Database connectivity powered by SQLAlchemy
- Excel integration via OpenPyXL
- Documentation via Claude.ai
Made with โค๏ธ for data engineers who love Excel configurations!