This File Renamer is a tool designed for Windows to rename a collection of vacation photos from various sources in a very simple, consistent, and specific way. The new naming format is primarily based on the date taken, when available, and can be represented as follows:
<year>_<month>_<day>_<hour>_<id>
Examples:
20230228_092122(0).png --> 2023_02_28_09_001.png
Snapchat-286861347.jpg --> 2023_03_02_17_002.jpg
Screenshot_20240620_124449_Chrome.jpg --> 2024_06_20_12_003.jpg
0 Travel Day (3aaa).heic --> 2024_06_20_17_004.heic
0 Travel Day (4).mp4 --> 2024_06_20_17_005.mp4
This tool was created for a very specific use case, so it is intentionally static and simple. Visit dcwelch.github.io/file_renamer for more high-level information.
- Renames files using date taken-equivelant metadata (e.g.,
DateTimeOriginal
for images) - Handles missing metadata gracefully with fallback timestamps (typically using last modified date)
- Designates these files in a separate, reviewable category prefixed with "ZZZ_"
- Support for a majority of common image and videos file formats, including...
- .png/.jpg/.jpeg image files via
pillow
- .heic image files via
pillow-heif
- .mp4/.mov video files via
ffprobe
- no other file formats are currently tested, but most others should process normally using the fallback date at a minimum
- .png/.jpg/.jpeg image files via
- Logs operations which maintain name mapping to...
- A live GUI log window
- A log file in the selected directory and a dedicated
logs
directory
- Intuitive GUI built with
Tkinter
- Built for Windows
Many similar tasks may find themselves better solved with one of these tools:
Visit dcwelch.github.io/file_renamer or the repo's Releases tab to download the executable and necessary supporting files, which are packaged together in a zip file called rename_files_executable.zip
.
- Python 3.12 or later
- The following Python dependencies (included in
requirements.txt
):pillow pillow-heif pytz piexif
- FFmpeg for
ffprobe
support (ensure it’s in your system PATH) - pyinstaller (only if a new executable is desired)
- Clone the repository:
git clone https://github.com/DCWelch/file_renamer.git cd file_renamer
- Install dependencies:
pip install -r requirements.txt
- Run the script:
python rename_files.py
To create a standalone executable:
- Install
pyinstaller
:pip install pyinstaller
- Use the following commands to generate the executable:
$piexif_path = python -c "import piexif; import os; print(os.path.dirname(piexif.__file__))" pyinstaller --clean --noconfirm --noconsole --icon=file_renamer_icon.ico --add-data "file_renamer_icon.ico;." --add-data "$piexif_path;piexif" --hidden-import=pillow_heif --hidden-import=pytz.zoneinfo --hidden-import=piexif --collect-all pillow_heif --collect-all piexif --exclude-module numpy --exclude-module mkl --exclude-module tcl --exclude-module tbb --exclude-module pywin32 --exclude-module psutil --log-level=DEBUG rename_files.py
- The executable will be located in the
dist/
folder
- Launch the application (via rename_files.exe)
- Use the
Pick Folder
button to select a target directory - Click
Start Renaming
to rename all files in the selected directory
file_renamer/
├── rename_files.py # Main script
├── requirements.txt # Dependencies
├── file_renamer_icon.ico # App icon
├── .gitignore # Specifies intentionally untracked files to ignore
├── LICENSE # License
├── README.md # Documentation
├── .github/ # Outlines GitHub Actions workflow for the build
│ └──
├── dist/ # Contains built executable (after running PyInstaller)
│ └── rename_files/
│ ├── rename_files.exe # Executable file to launch the file_renamer GUI
│ └── _internal/ # Contains necessary dependencies for the executable
│ ├── logs/ # Stores log files (created at runtime)
│ │ └──
│ └──
└── build/ # Contains build artifacts (after running PyInstaller)
└──
Contributions and feedback are always welcome! Here's how you can get involved:
If you encounter a bug or have ideas for new features, please use the GitHub Issues page to...
- Report Bugs: Provide a clear description, steps to reproduce, and any relevant logs or screenshots
- Request Features: Share your suggestions for new features or improvements
If you'd like to contribute code changes...
- Fork the repository
- Create a new branch for your feature or bug fix
- Submit a pull request with a detailed description of your proposed changes
Any feedback, suggestions, or contributions are greatly appreciated!
This project is licensed under the MIT License
Pillow
: For image processing and EXIF metadata handlingpillow-heif
: For HEIC/HEIF image supportpytz
: For timezone handlingFFmpeg
: For video metadata extraction viaffprobe
Tkinter
: For the GUI resourcesFlaticon
: Folder icons created by Freepik- The Python community: For providing the libraries and tools that power this application
For questions, feedback, or support, feel free to contact me at [email protected]