organize 
A file management automation tool.
Current Status
This is in really early development. Please come back later!
Background
The Python organize is a file management automation tool.
From their docs:
Your desktop is a mess? You cannot find anything in your downloads and documents? Sorting and renaming all these files by hand is too tedious? Time to automate it once and benefit from it forever. organize is a command line, open-source alternative to apps like Hazel (macOS) or File Juggler (Windows).
This is a Rust implementation of the same concept.
Example
-
Filter
files, which file stem ends withgo, recursive, maximum2levels deep:organize filter --recursive --max-depth 2 name --locations "C:\organize\" --targets files --ends-with "go" -
Filter
filesintwo locations, which extensions matchrsortoml, recursive, maximum2levels deeporganize filter --recursive --max-depth 2 extension --locations C:\organize --locations D:\folders --targets files --exts rs --exts toml -
Filter
filesandfolders, which are empty (0 bytesorno filesin directory), recursive, maximum4levels deep, ignoregitin path namesorganize filter --recursive --max-depth 4 empty --locations "C:\Users\dailyuse\dev-src\organize\" --targets both --ignore-path git -
Filter
filesandfolders, which are empty (0 bytesorno filesin directory), recursive, maximum4levels deep, ignoregitonly in file namesorganize filter --recursive --max-depth 4 empty --locations "C:\Users\dailyuse\dev-src\organize\" --targets both --ignore-name git
Media
Be aware: This is WIP. Not all functionality is implemented, (yet).
Main

Filters

Actions

Goals
For now the first goal for this Rust version of organize is to have feature parity with its Python equivalent.
BUT: I want to take another approach on tackling the problem. It is also relatively complicated to map all the stuff
within a config file, because we are bound to the syntax of yaml/json/toml/ron.
Maybe this is exactly the problem to solve!
Basically you want to have a configuration file, which replaces a mini scripting language.
With predefined filters and actions that are applied to the items that the filter spits out.
Basically almost everything in the configuration files are parameters for functions/methods.
This makes everything more complicated.
-
What if we implement rusty
organizein a way, that we can callorganize filter extension --ext "exe, msi, apk" --path {}and it spits out all the paths that match thisprecodedfilter? This way we can already utilize it easily within shell scripts. -
On the second implementation stage, we can embed a scripting engine like rhai, where we expose some functionality of rusty
organizeasfunctionsand register them with therhaiengine. -
Instead of pressing everything in a complicated configuration file syntax, we can utilize a scripting language and boil it down to its minimum syntax.
That being said, a big factor for the Rust reiteration for me is that I like Rust. I want to reimplement organize's approach in a language that has better error handling, and makes it easier to maintain software. That is fast and at the same time makes development less error prone.
I'm the first user of the Rust implementation, and will be going to use it with my private files. Thus an important goal for me is stability.
License
AGPL-3.0-or-later; see LICENSE.