An Intelligent file organizer module which reads your file storing pattern & move the cluttered files accordingly!
Author: | Abhinav Anand |
---|
Contents
Let's accept, no one likes to organize files on a regular basis. Even if you do, you wouldn't want to do it everytime you download a new file.
Guess what! Filezen got you covered.
Given a folder of your cluttered/unorganized files, using Filezen
, you can achieve
the following
Filezen's Basic Scanner
can create suitable folders and organize your file into them.Filezen's Advanced Scanner
can read your file storing pattern and move your files accordingly.Pathlib
if only you're working with Python 2.x )JSON
objects$ pip install Filezen
If you are behind a proxy
$ pip --proxy [username:[email protected]]domain_name:port install Filezen
Note: If you get command not found
then
$ sudo apt-get install python-pip
should fix that
$ git clone https://github.com/ab-anand/Filezen.git
$ cd Filezen/
$ pip install -r requirements.txt
$ python setup.py install
Note: If you get permission denied
then
$ sudo python setup.py install
should fix that
Simple Scanner
uses a predefined mapping of filetypes to folder e.g. ".csv": "Documents"
.Simple Scanner
>>> from filezen import SimpleScanner as scanner
>>> input_directory = "/home/abhinav/Downloads"
>>> output_directory = "/home/abhinav/Documents"
>>> result = scanner.cleanDirectory(input_directory, outputPath=output_directory)
>>> print(result)
'{
"Moved": [
"FileA.pdf",
"FileB.txt",
"FileC.mp4",
"FileD.log",
"FileB.xyz"
],
"NotMoved": [
]
}'
Simple Scanner
would treat Input Directory as the Output Directory thus creating folders in the Input Directory itself.Advanced Scanner
maintains a heap
for each filetype/file-extension it encounters while scanning the Output Directory.heap
contains all the directory addresses where a particular filetype(e.g. "pdf"
) occurs.heap
Advanced Scanner
scans the child
as well as sibling directories
(at the same level).depth
parameter as shown in the example below.depth = 5
Advanced Scanner
>>> from filezen import AdvancedScanner as scanner
>>> input_directory = "/home/abhinav/Downloads"
>>> output_directory = "/home/abhinav/Documents"
>>> depth = 3
>>> result = scanner.cleanDirectory(input_directory, outputPath=output_directory, depth=depth)
>>> print(result)
'{
"Moved": [
"FileA.pdf",
"FileB.txt",
"FileC.mp4",
"FileD.log",
"FileE.xyz"
],
"NotMoved": [
]
}'
Advanced Scanner
would read the folders in the Input Directory itself and move accordingly.Note: If a file with the same name is already present in the Output Directory then Filezen
would
ignore the file and leave it to the user. In the resulting JSON, you'll get the all such filenames which
were not moved in the NotMoved
list.
Filezen
to organize file.For a detailed usage example, refer the documentation at Read the Docs
Please refer Contributing page for details
Please report the bugs at the issue tracker
Built with by Abhinav Anand under the MIT License
You can find a copy of the License at http://abhinav.mit-license.org/