Python tool for processing EL (Electroluminescence) image files with database integration and automated file movement.
main_naming.py: Extracts serial numbers from JPG filenames
- Takes first 20 characters of filename (without .jpg extension)
- Can process single files or entire directories
- Outputs filename-serial pairs for database lookup
remote_update.py: Moves files to their correct network locations
- Uses main_naming.py to get serials from local JPG files
- Queries database to find where each file should go
- Moves files from local folder to database-specified network paths
- Handles path conversion from database format to network share format
-
Install dependencies:
pip install -r requirements.txt
-
Create configuration file:
# Create your own config.py - contains sensitive company data # Edit with your database credentials and network paths
-
Setup test database:
python setup_sqlite_database.py
IMPORTANT: Create your own config.py file as it stores sensitive company data. Never commit this file.
Key settings:
DB_TYPE- "sqlite" for testing, "mssql" for production- Database connection details (server, credentials for SQL Server)
- Path mapping:
DB_PATH_PREFIXandNETWORK_SHARE_BASE
The tool converts database paths like /EL/HEL001/file.jpg to network paths like \\server\share\HEL001\file.jpg
python main_naming.py /path/to/images # Show serials for all JPGs
python main_naming.py /path/to/images --csv out.csv # Export to CSV
python main_naming.py /path/to/images --quiet # Just output tuplespython remote_update.py /path/to/local/files --dry-run # Preview only
python remote_update.py /path/to/local/files # Actually move filesHow it works:
- Scans local folder for JPG files
- Extracts serial numbers using main_naming.py
- Queries database to find correct network path for each file
- Moves files from local folder to network destinations
python test_database_connection.py- Never commit
config.py- contains sensitive credentials - Test in development before production use
- Ensure proper network share permissions