A simple, Python File organizer
A small python software I wrote out of my need to better organize my Desktop and folders. Sometimes, when time is short and the workload doesn't allow me to, I tend to fill my Desktop with unsorted files.
Behind the scenes, this software will use a settings file ('settings.ini') and will read information about how you expect your files organized. It allows you to have your own rules about how to organize the files.
To safely move the files I used the .replace function from the "os" library. Further implementation for unix systems may use the mv function.
1. Here there are two options. You can either download the binary. It was compiled using pyinstaller and should run out of the box for any Windows device.
2. You can also grab this repository and start it with python. Make sure to install the requirements from
requirements.txt
file! Simply start it by running python main.py
3. That's it!
As stated above, the usage is self explainatory, you will be shown a menu with 3 options.
1. First option (Start) will run the software and will prompt you to choose the folder you want to organize. It will then parse your settings.ini file and according to that, move the files and folders in a new folder called "Backup - timestamp", where to timestamp is the current time (date - time).
2. This option (Customize) will open the
settings.ini
file and allow you to modify and customize for your needs. Inside, you will find something like: [Formats]
Music = .mp3,.wav
Documents = .txt,.rtt,.ppt
Pictures = .png,.jpg
You can edit this and for example add a new category. Let's say you want all of your video files to be moved in a folder called "Winter Memories", simply add it inside the Format category. Our modified file will look like this:
[Formats]
Music = .mp3,.wav
Documents = .txt,.rtt,.ppt
Pictures = .png,.jpg
Winter Memories = .mp4,.mkv,.avi
There are no limitations as to how many categories / extensions you can add. Please note that any file that does not fit into a category will simply be moved to the "others" folder.
This project does what it is supposed to do, but for further developing more options can be added to simplify even more. Ideas that can be implemented, depending on your use case include:
- Folder archiving (to ease storage when backing up) Here, I'd go with shutil library. It supports both zip and tar archives and allows one-line arhive creation.
- FTP backup of your files. So that you are sure you have an extra copy. I'd use ftplib here, as it is pretty straightforward
- Dropbox also provides a python API that can be used to store files in the cloud.
Feel free to use this software as you wish! It is free, opensource and no credits are required if you decide to use it!