A fast, lightweight desktop tool to import Excel files (.xlsx / .xls) into a SQLite database. Built with Python and Tkinter — no browser, no internet, no installation required (when using the .exe).
- Import multiple Excel sheets into a single SQLite table called
Data - Choose where to save the
.dbfile using a standard Save As dialog - Performance presets to match your PC's RAM and CPU
- Real-time progress bar showing current sheet and total row count
- Stop button to cancel import at any time
- Live log console inside the app
- Works as a standalone
.exe— no Python needed on target machines
UI includes: Excel file picker, Save location picker, Performance preset dropdown, Start/Stop buttons, Progress bar, and log console.
If running from source:
Python 3.8+
openpyxl
Install dependency:
pip install openpyxlpython excel_to_sqlite.pyInstall PyInstaller:
pip install pyinstallerBuild the executable:
pyinstaller --onefile --windowed --name "ExcelToSQLite" excel_to_sqlite.pyThe .exe will be output to:
dist\ExcelToSQLite.exe
No Python installation is required on the machine running the .exe.
- Browse — Select your Excel file (
.xlsxor.xls) - Save As — Choose where to save the output
.dbfile and give it a name - Preset — Pick a performance level based on your PC specs
- START — Begin the import
- STOP — Cancel at any time (data inserted so far is saved)
| Preset | Batch Size | Cache | Recommended For |
|---|---|---|---|
| Low | 500 rows/tx | 16 MB | Old PCs, 2GB RAM |
| Medium | 2,000 rows/tx | 32 MB | Average office PCs, 4–8GB RAM |
| High | 5,000 rows/tx | 64 MB | i5 / 16GB+ RAM |
| Ultra | 10,000 rows/tx | 128 MB | i7–i9 / 32GB+ RAM |
All sheets from the Excel file are merged into a single table named Data.
- The first row of each sheet is treated as column headers
- An
idcolumn is automatically added asPRIMARY KEY AUTOINCREMENT - All columns are stored as
NVARCHAR - Column names are sanitized to be valid SQL identifiers
Given an Excel file with this structure:
| SERIES_NUMBER | IMAGE_NUMBER | LINE | NAME | TYPE |
|---|---|---|---|---|
| d_001 | img_001 | 1 | Martha | GIVENNAME |
The resulting SQLite table Data will look like:
| id | SERIES_NUMBER | IMAGE_NUMBER | LINE | NAME | TYPE |
|---|---|---|---|---|---|
| 1 | d_001 | img_001 | 1 | Martha | GIVENNAME |
The following SQLite PRAGMAs are used internally for maximum import speed:
PRAGMA journal_mode = WAL -- Write-Ahead Logging for faster writes
PRAGMA synchronous = OFF -- Skip fsync calls (biggest speed gain)
PRAGMA cache_size = -N -- Large in-memory page cache
PRAGMA temp_store = MEMORY -- Temp tables stored in RAM
PRAGMA locking_mode = EXCLUSIVE -- No per-write lock overheadCombined with large batch executemany() inserts inside explicit BEGIN / COMMIT transactions.
- The
sqlite_sequencetable that appears in SQLite viewers is automatically created by SQLite to track AUTOINCREMENT counters. It is not your data — ignore it. - If the app is closed during import, the current batch is finished before the window closes.
- Re-running the import on an existing
.dbfile will append rows to the existingDatatable. Delete the.dbfile first if you want a fresh import.
excel_to_sqlite.py # Main application source
README.md # This file
dist/
ExcelToSQLite.exe # Built executable (after running PyInstaller)
MIT License. Free to use, modify, and distribute.