
- #Mass photo renamer how to#
- #Mass photo renamer install#
- #Mass photo renamer full#
- #Mass photo renamer code#
#Mass photo renamer how to#
If you have any questions, please reach out on twitter or open a GitHub Issue.FAQs How to use the online bulk file renaming tool? You can also change how the naming scheme works to better fit your organizational needs. Feel free to add more tooling and case handling to this function to take care of situations were files aren't JPGs within the entered directory, or even attach a GUI to make this script extra user friendly.
#Mass photo renamer code#
There you have it! A short 25 lines of code to save you hours of time in the future. If you have been following along in your IDE of choice, you can simply run the script there, but if you want to be able to run it from the CLI at anytime, you can run the following command (for Mac): python3 PATH/TO/SCRIPT/photo-crawler/main.py After the for loop finishes we print out a helpful “Done!” as the process ends. Within the for loop, we put together the strings for the new image name and old image name and go through one by one renaming them all.
#Mass photo renamer full#
Please note that the file names also contain the full path to that file. For example: os.rename("Desktop/photos/photo1.jpg", "Desktop/photos/London-Jan2020-AG-1.jpg") The function that does the renaming is os.rename() which takes an input of the old file name and the new file name.

Notice also that we create an iterator (i) to enumerate our photos to make sure that every photo is names differently. The next step is create a loop to run through all the files in the given directory with os.listdir(), where the the function parameter is a string to the relevant directory. directory = str(input("Please enter the directory of your photos")) This gives us all the necessary information to put together an informative file name that is robust against dates and photographers. Desktop/photos), the location where the photos were taken, the date that the photos were taken, and their initials. Next, we will prompt the user for input of the directory in which their images are stored (ex. We start by importing the os module, defining our main function, and showing the user some instructions on using the file. Location = input("Please enter the location where these photos were taken.")ĭate = input("Please enter the date when these photos were taken.")Ĭredit = input("What are the initials of the photographer?") "you have filled out a response, press ENTER to submit it.")ĭirectory = str(input("Please enter the directory of your photos")) The only required question is the first one. "wish not to fill it out, just press ENTER without leaving a " Print("Please follow the instructions below. # ask user for some info about photos on run. London-Jan2020-AG-1.jpg) Building Your Re-Namerīelow is the completed code, you can have a look at it as an overview before we go through the major sections: import os The goal is to write a function that takes a directory of photos as input and renames them all with the following naming scheme: Location-Date-PhotographerInitials-Enumeration.jpg (ex.
#Mass photo renamer install#
You can install Python 3 here if you need to. This script is written in Python 3, and the only module that you’ll need is the os module, which already comes standard with Python. In this article, we will go through the process of writing such a script, should you want your own, but you can find the completed function here:, ready to use out of the box.

So, with the help of a short python script, you can rename whole swaths of photos at once per a specific and informative naming scheme at the push of a button.

Renaming photos individually is very time consuming - not to mention incredibly boring! Photos taken during a trip can take you back to some of your most cherished memories, but it’s an endless battle to keep them all organized, so that future you doesn’t have to sift through a formless blob of indecipherably numbered jpg files just to find the right one.
