CLI Usage

difPy can be invoked through a CLI interface by using the following commands:

python dif.py #working directory

python dif.py -D 'C:/Path/to/Folder/'

python dif.py -D 'C:/Path/to/Folder_A/' 'C:/Path/to/Folder_B/' 'C:/Path/to/Folder_C/'

Note

Windows users can add difPy to their PATH system variables by pointing it to their difPy package installation folder containing the difPy.bat file. This adds difPy as a command in the CLI and will allow direct invocation of difPy from anywhere on the machine. The default difPy installation folder will look similar to C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\difPy (Windows 11).

difPy in the CLI supports the following arguments:

dif.py [-h] [-D DIRECTORY [DIRECTORY ...]] [-Z OUTPUT_DIRECTORY]
       [-r {True,False}] [-i {True,False}] [-le {True,False}]
       [-px PX_SIZE]  [-s SIMILARITY] [-ro {True,False}]
       [-dim {True,False}] [-proc PROCESSES] [-ch CHUNKSIZE]
       [-mv MOVE_TO] [-d {True,False}] [-sd {True,False}]
       [-p {True,False}]

Cmd

Parameter

Cmd

Parameter

-D

directory (str, list)

-la

same_dim (bool)

-Z

output_directory

-proc

processes (int)

-r

recursive (bool)

-ch

chunksize (int)

-i

in_folder (bool)

-mv

move_to (see search.move_to)

-le

limit_extensions (bool)

-d

delete (see search.delete)

-px

px_size (int)

-sd

silent_del (bool)

-s

similarity (str, int, float)

-p

show_progress (bool)

-ro

rotate (bool)

If no directory parameter is given in the CLI, difPy will run on the current working directory.

The output of difPy is written to files and saved in the working directory by default. To change the default output directory, specify the -Z / -output_directory parameter. The “xxx” in the output filenames is the current timestamp:

difPy_xxx_results.json
difPy_xxx_lower_quality.txt
difPy_xxx_stats.json