RenameX is a lightweight, dependency-free Python CLI tool that lets you bulk-rename files in any folder by swapping their file extension β fast, simple, and safe.
- About
- Preview
- Features
- Installation & Setup
- How To Use
- How It Works
- Use Cases
- Project Structure
- Important Notes
- Contributing
- Show Your Support
- License
RenameX is a simple but powerful Python CLI tool that lets you bulk-rename files in any folder by swapping their file extension. Instead of manually renaming files one by one, just run the script, enter your folder path and the two extensions β and the tool handles the rest instantly.
================================================================
____ _ __
/ __ \___ ____ ____ _____ ___ ____| |/ /
/ /_/ / _ \/ __ \/ __ `/ __ `__ \/ _ \ /
/ _, _/ __/ / / / /_/ / / / / / / __/ |
/_/ |_|\___/_/ /_/\__,_/_/ /_/ /_/\___/_/|_|
================================================================
[*] Tool : RenameX - File Extension Changer
[*] Version : 1.0
[*] Developer : SUJOY LAYEK
[*] Description : Fast and secure bulk file extension modifier.
================================================================
| Feature | Details |
|---|---|
| π¨ ASCII banner | Styled terminal banner displayed on startup |
| π Any folder supported | Use any path, or press Enter to use the current directory |
| π Dry-run preview | Shows you exactly what will be renamed before touching any files |
| β Confirmation prompt | You must type y to confirm β nothing renames by accident |
| π Bulk renaming | Renames all matching files in a single confirmed run |
| β Auto dot correction | Type txt β it auto-corrects to .txt and tells you |
| π‘οΈ Input validation | Re-asks for input if an extension is left blank |
| π‘οΈ Folder validation | Validates the path before scanning or changing anything |
| π« Duplicate guard | Skips files where the renamed target already exists |
| π Same-extension guard | Detects if source and target are identical β exits early |
| π Rename summary | Shows [OK] / [Skip] / [Error] for each file + final count |
| Catches permission errors without stopping the rest of the process | |
| β¨οΈ Ctrl+C support | Press Ctrl+C at any time to exit cleanly β no scary traceback |
| β No dependencies | Uses only Python's built-in os module |
- Python 3.6 or higher
- No external libraries required β uses only the built-in
osmodule
1. Clone the repository
git clone https://github.com/sujoylayek2006/RenameX.git
cd RenameX2. Run the script
python src/main.pyNo
pip installneeded β this tool uses only Python's built-in libraries!
git clone https://github.com/sujoylayek2006/RenameX.git
cd RenameXpython src/main.pyStep 1 of 3 β Folder
Enter the full path to the folder you want to work in.
Press Enter to use the CURRENT directory.
Folder path: C:\Users\Sujoy\Documents\notes
Press Enter to use the current directory β the full resolved path is printed so you always know where you are.
Step 2 of 3 β Source Extension
This is the extension your files currently have.
Enter source extension (e.g. .txt): txt
[+] Auto-corrected to: '.txt'
If you forget the dot, it is auto-added and shown to you β
txtbecomes.txt.
Step 3 of 3 β Target Extension
This is the extension you want to rename your files TO.
Enter target extension (e.g. .txt): md
[+] Auto-corrected to: '.md'
Scanning 'C:\Users\Sujoy\Documents\notes' for '.txt' files...
Preview β 3 file(s) will be renamed:
todo.txt -> todo.md
ideas.txt -> ideas.md
summary.txt -> summary.md
Proceed with renaming? (y/n): y
You see every rename before it happens. Type
yto proceed ornto cancel safely.
[OK] todo.txt -> todo.md
[OK] ideas.txt -> ideas.md
[OK] summary.txt -> summary.md
Done! 3 renamed
- The script starts and displays the RenameX ASCII banner with tool metadata.
- The user is guided through 3 numbered steps: folder path β source extension β target extension.
- At each step, input is validated β empty extensions are rejected, missing dots are auto-added.
- If source and target extensions are the same, the script exits early with a clear message.
- The script validates that the folder exists β if not, it stops safely with a helpful hint.
- It scans the folder and builds a list of all files matching the source extension.
- A dry-run preview shows every planned rename before any file is touched.
- The user confirms with
yβ typing anything else cancels cleanly with no changes made. - Each file is renamed using
os.rename(). If a target filename already exists, that file is skipped. - Errors (e.g. permission issues) are caught and reported per-file without stopping the rest.
- A final summary shows counts of renamed, skipped, and failed files.
| Scenario | Example |
|---|---|
| π Convert notes format | Rename all .txt files to .md for Markdown editors |
| πΌοΈ Batch photo renaming | Change .jpeg files to .jpg for consistency |
| π Web asset migration | Rename .html files to .htm for legacy server support |
| π Data file conversion | Switch .csv files to .tsv after a format change |
| π Script file prep | Rename .py files to .pyw for Windows GUI scripts |
| ποΈ Log file management | Convert .log files to .txt for easier reading |
RenameX/
βββ src/
β βββ main.py # Main RenameX script
βββ examples/ # Example usage walkthrough
β βββ 1.Before_RenameX.png
β βββ 2.Terminal_before.png
β βββ 3.Terminal_after.png
β βββ 4.After_RenameX.png
β βββ EXAMPLES.md
βββ .gitignore # Git repository settings
βββ README.md # This file
βββ LICENSE # License file
βββ requirements.txt # Dependency info (none required)
Warning
Always backup important files before running RenameX. Extension renaming modifies files in place and cannot be automatically undone.
- π Preview before you commit β RenameX always shows a dry-run preview and asks for confirmation before touching any files.
- π Ensure the correct folder path is provided β an invalid path halts the script before any changes are made.
- π§ͺ Test on sample files first β create a test folder with dummy files and verify the preview looks right before applying to real data.
- π‘ Extensions are case-sensitive on some systems (e.g.,
.TXTβ.txton Linux/macOS). - π« The script only renames files in the top-level folder β it does not recurse into subfolders.
- β¨οΈ Press Ctrl+C at any time to exit safely β no files will be changed.
Contributions are welcome and appreciated! Here's how you can help:
- Fork the repository
- Create a new branch for your feature or fix:
git checkout -b feature/your-feature-name
- Make your changes and commit them with a clear message:
git commit -m "feat: add your feature description" - Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request β describe what you changed and why.
Please make sure your code follows the existing style and is well-commented.
If RenameX saved you time or helped you learn something new, consider showing your support:
- β Star this repository on GitHub
- π΄ Fork it and build something cool on top of it
- π Report bugs or suggest features via Issues
- π£ Share it with friends or classmates who might find it useful
Every bit of support motivates further development β thank you! π
This project is open-source and free to use for personal or educational purposes. This project is licensed under the MIT License.
Made with β€οΈ by SUJOY LAYEK using Python