Python is a versatile language, with powerful built-in and external libraries. I have made it my mission for the last year to automate as much of my life with Python to remove tedious tasks such as searching files, organizing folders, extracting stock market data, etc. If I could count how mu ch of my day I spend dragging folders around and sorting them by the time it would probably amount to around an hour or so. An hour that could be easily be utilized productively for other tasks.

That is when I decided to sit down and write a script that organizes the files in my folder based on their extension, and automatically move them to their respective folders. The script took me around 2 hours and the criteria for the organization is as follows:

  • Documents – doc,docx,txt,pdf
  • Video – mkv,mp4,webm,mov,avi,m4v
  • Audio – mp3,wav,flac,
  • Images – psd,jpg,png,tiff,bmp,
  • Zip Files – zip,rar,7z,iso
  • Code – html,css,py,js,php,rb,xml,json,pyw,c,sh,bat,cs,java
  • Folders – Self Explanatory
  • Other – Any extensions that were not mentioned above

I will show you an example of a folder before and after I used the script on it:

Before:

After:

I plan to create more automation scripts as I learn different libraries and I plan on creating a mega project with multiple scripts all with their own GUIs that I plan to create on my GitHub page.

You can find the link to this project at: https://github.com/Sharizzle/Python-File-Sorter