Usage

SimpleScanner

NOTE ON SIMPLESCANNER

  • This program uses a predefined mapping

to store a particular file type from the input directory.

  • Validates the folder location and moves a file

according to the mapping.

  • If a file with the same name is already present in

that mapping directory, then the file won’t be moved.

class filezen.simpleScanner.simplescanner.SimpleScanner

Bases: filezen.scanner.scanner.Scanner

This class moves the input files using a predefined mapping. Inherits some methods from Scanner.

cleanDirectory(inputPath, outputPath=None)

The main functions which takes inputPath & outputPath and validates them. Then calling the required functions in order to move the files to their respective locations

Parameters:
  • outputPath (string) – absolute path of the folder containing output files
  • inputPath (string) – absolute path of the folder containing input files
Returns:

json containing list of file that were moved/not-moved

setOutputPath(outputPath)

set the output folder

Parameters:outputPath (string) – the output folder where the files needs to be moved

Module contents

Advanced Scanner

NOTE ON ADVANCEDSCANNER

  • This program uses the FREQUENCYHEAP to

maintain the most used folder location to store files of a particular type.

  • Using the heap built, it move the files to the

corresponding directory.

  • If a file with the same name is already present in

that mapping directory, then the file won’t be moved.

class filezen.advancedScanner.advancedscanner.AdvancedScanner

Bases: filezen.scanner.scanner.Scanner

This class maintains a dictionary with key being the file type and value being a FREQUENCYHEAP. It then move the files according to this dictionary. Inherits some methods from Scanner.

cleanDirectory(inputPath, depth=5, outputPath=None)

The main functions which takes inputPath, outputPath, depth and validates them. Then calling the required functions in order to move the files to their respective locations

Parameters:
  • outputPath (string) – absolute path of the folder containing output files
  • depth (integer) – levels of folders to scan
  • inputPath (string) – absolute path of the folder containing input files
Returns:

json containing list of file that were moved/not-moved

setDepth(depth)

set the depth of scanning

Parameters:depth (int) – the depth up to which scanning would be done
setOutputPath(outputPath)

set the output folder

Parameters:outputPath (string) – the output folder where the files needs to be moved

Module contents