A lightweight Python tool to find and replace a word or phrase across all files of a given suffix in a directory — fast, local, and dependency-free.
No CLI. No config files. No cloud. Just point it at a folder and go.
📁 Targets all files of a given suffix in a directory 🔍 Find and replace any word or phrase 🔡 Optional case-insensitive matching 🖥️ Minimal dark-themed GUI built with CustomTkinter 🔐 100% offline — nothing leaves your machine 🐍 Pure Python standard library (no dependencies for the core)
-
Download the latest release from Releases
-
Extract the ZIP
-
Run Text_Swap.exe
No installer required. No Python required.
Python 3.10+
For the GUI only:
pip install -r requirements.txt- Choose the directory containing your files
- Set the file suffix (e.g.
.txt,.sql) - Enter the word or phrase to find, and what to replace it with
- Hit Run
The tool processes every matching file in the directory and reports how many replacements were made per file.
swap(directory, suffix, find, replace, case_insensitive=False)| Parameter | Type | Description |
|---|---|---|
directory |
str |
Path to the target folder |
suffix |
str |
File extension to target, e.g. .txt or .sql |
find |
str |
Word or phrase to search for |
replace |
str |
Word or phrase to replace with |
case_insensitive |
bool |
Case-insensitive matching. Defaults to False |
- Only files directly inside
directoryare processed — subdirectories are ignored - Files are read and written as UTF-8; unreadable files are skipped
- Special regex characters in the
findstring are treated as plain literals
MIT License
Because small tools should:
- Do one thing well
- Stay out of your way
- Respect your files
Issues and suggestions are welcome via GitHub Issues.