Owner: Brad Youles
Status: Active
Last reviewed: 2026-07-15
This desktop application searches SQL files, Python files, and Jupyter notebooks for one or more case-insensitive terms. It recursively scans a selected folder, displays matching lines in the application, and exports all results to a CSV file.
The application searches:
- SQL files (
.sql) - Python files (
.py) - Jupyter notebooks (
.ipynb)
For Jupyter notebooks, the application searches both code cells and Markdown cells.
- Python 3.8 or newer
- Tkinter
Tkinter is included with most standard Windows Python installations. No third-party Python packages are required.
Open PowerShell or Command Prompt in the folder containing the script.
Run:
python search-app.pyIf the python command is not available, run:
py search-app.pyReplace search-app.py with the actual script name if it differs.
- Select Choose Folder.
- Select the top-level folder to search.
- Enter one or more comma-separated search terms.
- Select Search or press Enter while the search-term field is active.
- Review the matches displayed in the application.
- Open
search_results.csvin the selected folder for the complete exported results.
Example search terms:
employee_id, release_version, lab_id
Searches are case-insensitive. For example, searching for employee_id also finds EMPLOYEE_ID, Employee_ID, and employee_id.
The application recursively scans all supported files under the selected folder.
Each search term is evaluated separately. If the same term occurs more than once on a line, each occurrence is recorded as a separate match.
For SQL and Python files, the location is reported as a source-file line number:
line 42
For Jupyter notebooks, the location includes the cell number, cell type, and line within the cell:
cell 7 (code), line 4
The search includes matches in:
- Source code
- Comments
- String values
- SQL statements
- Jupyter code cells
- Jupyter Markdown cells
The application performs literal text matching. It does not currently support regular expressions or syntax-aware searching.
The application writes the results to:
search_results.csv
The file is saved in the top-level folder selected for the search. A new search overwrites the existing file.
The output includes:
| Column | Description |
|---|---|
file_path |
Full path to the matching file |
file_kind |
File type: sql, python, or ipynb |
needle |
Search term that matched |
location |
Source line or notebook cell location |
start_index |
Zero-based character position where the match begins |
line_preview |
Preview of the matching line |
The CSV uses UTF-8 encoding with a byte-order mark so it opens correctly in Microsoft Excel.
The application does not search these directories:
.git
.venv
venv
__pycache__
.ipynb_checkpoints
The ignored directories are defined in the script:
IGNORE_DIRS = {
".git",
".venv",
"venv",
"__pycache__",
".ipynb_checkpoints",
}Add additional directory names to this set when needed.
The supported extensions are defined in the script:
SEARCHABLE_SUFFIXES = {".sql", ".py", ".ipynb"}Additional text-based file types may be added to this set, but the search-routing logic must also send those files to the appropriate search function.
Enter multiple terms as a comma-separated list:
release_version, employee number, final_cluster
The application:
- Removes leading and trailing spaces
- Ignores blank entries
- Removes duplicate terms case-insensitively
- Treats commas as separators
The current version cannot search for a literal phrase that contains a comma.
The application displays an error message when:
- No folder is selected
- The selected path is invalid
- No search terms are entered
- The results CSV cannot be written
If an individual file cannot be read or a notebook cannot be parsed, the application records the error in the results and continues scanning the remaining files.