If you have a mac, your Donwloads folder is a mess. This script comes to save you. This module was intended to be an extensible implementation for anyone to introduce changes on runtime
- open
settings.pywith your text editor of choice and follow the instructions below. SOURCE_FOLDER_PATH = ...should point to the full path to the folder where changes may occur.DESTINATION_FOLDER= ...should point to the full path of the root folder where the (now clssified) files will be.- Run
chmod u+x run.shthis just allow your shell to execute the filerun.sh - Run
./run.shthis will create a virtualenv and download the necessary requirements, after that start watching for your folder.
If you want to make a new handler for an extension which is currently not implemented or just pourly handle you can! YAFM was build with extension as a core principle.
-
Create a new python file inside the module
apps(eg:example_handler.py). -
Create your handler class, be sure to extend
Injector. For that,from injector import Injector -
Your newly created handler must implement
process_file(self, path)which must return a string representing the sub path underDESTINATION_FOLDERwhere the file should be moved to. -
In
settings.pyinside theAPPS = [...]include a new row as{'app': 'example_handler', 'config': {'sub_folder': 'Example', 'types': ['pdf']}}- The
'app'attribute reference the file name. - The
'sub_folder'attribute reference the Subfolder to be generated under theDESTINATION_FOLDER. This will be consider the base direction for any file given to this handler, but inside you can just go as deep as you want! - The
'types'attribute represents an array of all accepted types for this module. Make sure no two apps clash with the types they accept as we cannot asure you which one will process each file.
- The
-
Now you can use
PhotoInjectorfor image classification of your downloads.- Inside
settings.pyyou'll add an entry forAPPS = [...]. - The new entry should look like this:
{'app': 'photo_injector', 'config': {'sub_folder': 'Image', 'known_path': 'path/to/folder' ,'types': ['png', 'jpeg', 'jpg']}} - For this injector to work you'll specify a folder path in
known_pathcontaining one image for each person you want to classify. Each photo should contain the person's face looking forward (please, this is crucial for performance and accuracy). The name of each photo will be used to create each folder inside theDESTINATION_FOLDER.
- Inside
Please be kind, this is a side project. If you have any suggestions or want to contribute, i encurage you to do so!.
- python3
- virtualenv
email: [email protected]