Declutter your Downloads folder with Python 😎
We download tons of files daily from the internet.
If you are a Windows user, they most probably land up in your Desktop folder by default, making it look like a mess.
For Unix users, it's generally the
Having all the files in one folder makes it hard to navigate. It takes more time to reach the desired file. And it simply looks bad.
One great way of organizing files is by their mime type. That is, all the images go to one folder, all the pdfs to another, and so on.
So I made a simple tool, that can declutter your downloads folder.
How to install?
dirganize is published to the Python Package Index. So, why wait, you can easily install it with a single
❯ pip install dirganize
How to use ?
Navigate into the directory, which you want to organize, and run the
❯ cd Downloads ❯ dirganize Creating mapping ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 Moving files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
And that's it. Your folder is organized.
ls command (or
dir for Windows) before and after executing
dirganize to see the magic.
Your folder. Your rules.
Want to change the rules? I mean the rules that govern which file goes to which folder.
Then simply, put a
.dirganize.yml file inside the folder to override the default configuration.
A yaml file is basically converted to a python dictionary by
dirganize. The default dictionary is overwritten by the user-defined configuration (when available).