Package: dirdf
Never mind explorer.exe, here is dirdfAre you one of those people who have never any space on their hard disk? Do you spend hours and hours searching for your files because you never remember where you saved them? Well, since I am one of those, I tried several tools in the past: TreeSize / WinDirStat / WizTree / SpaceSniffer / GREP. They all are great,but take forever to get the job done and only offer limited filter functions. Around 5 hours ago, after having searched around 30 minutes for a file on my hard drive, I decided to do something about it ...Install the package (Windows only)pipinstalldirdfInstall Cygwin (ls.exe is necessary for getting the file list)ls.exe.Tools needed for some functionsstrings.exe.rg.exe.fzf.exe.It is recommended to add strings.exe/rg.exe/fzf.exe/ls.exe files to your pathfromdirdfimportpd_add_dfdirpd_add_dfdir()importpandasaspddf=pd.Q_folder_to_df(folder=r"C:\Users\blabla",ls_path="ls",last_access_time=True,exit_keys="ctrl+x",timeout=None,)df2=pd.Q_folder_to_df_with_functions(folder=r"C:\Users\blabla",ls_path="ls",last_access_time=True,exit_keys="ctrl+x",timeout=None,strings_path="strings",fzf_path="fzf",rip_grep_path="rg.exe",add_flatcopy_sorted=True,add_flatcopy=True,add_extract_strings=True,add_fuzzy_extract=True,add_ripgrep=True,add_open_file=True,add_move_file=True,)# Some examples# Flatcopy - foldersep='ǀ' means that the backslash ‘\’ will be replaced by 'ǀ'. The replacement is important because there is no “flat copy” with a backslash in the path! All file types (pdf, jpg ... ) will get their own folder. If you want to save space, create a symlink instead of copying the whole filedf.loc[df.aa_fullpath.str.contains(r'\.txt|\.docx|\.jpg')][:100].ff_flatcopy_sorted.apply(lambdax:x('f:\\testflatcopy_df',foldersep='ǀ',symlink=False,copystat=True))df.loc[df.aa_fullpath.str.contains(r'\.txt|\.docx|\.jpg')][:100].ff_flatcopy_sorted.apply(lambdax:x('f:\\testflatcopy_df\\symlink',foldersep='ǀ',symlink=True,copystat=True))# copystat will be ignored in this case# Flatcopy without sorting file typesdf.loc[df.aa_fullpath.str.contains(r'\.txt')][2:100].ff_flatcopy.apply(lambdax:x('f:\\newfoldertest\\flatcopy'))df.loc[df.aa_fullpath.str.contains(r'\.txt')][2:100].ff_flatcopy.apply(lambdax:x('f:\\newfoldertest\\flatcopy\\sym',symlink=True))# Extract all strings from any filedf.loc[df.aa_fullpath.str.contains(r'\.txt')][:100].ff_extract_strings.apply(lambdax:x(exit_keys='ctrl+x',print_output=True,timeout=None))# Fuzzy search in any filedf.loc[df.aa_fullpath.str.contains(r'\.txt')][:100].ff_fuzzy.apply(lambdax:x('windows'))# Regex search in any filedf.loc[df.aa_fullpath.str.contains(r'\.txt')][:100].ff_ripgrep.apply(lambdax:x(regular_expression='name',other_parameters='-i',exit_keys='ctrl+x',print_output=True,timeout=.1))# Executes os.startfile()df.loc[df.aa_fullpath.str.contains(r'\.txt')][:100].iloc[0].ff_open()# Moves files, keeps the folder structurdf.loc[df.aa_fullpath.str.contains(r'\.txt')][:1].ff_move_file.apply(lambdax:x('f:\\newfoldertest'))dfOut[3]:aa_date...aa_filetype02022-10-2312:18:58.767317900-03:00....012022-10-2305:48:51.755017400-03:00....yaml22022-10-2305:51:47.520702700-03:00....jpg32022-10-2305:51:46.817189600-03:00....jpg42022-10-2305:48:51.755017400-03:00....yaml52022-10-2312:18:58.767317900-03:00....csv62022-10-2305:51:49.630625800-03:00....jpg72022-10-2305:51:52.116036400-03:00....jpg82022-10-2305:51:52.678404900-03:00....jpg92022-10-2313:31:03.003835900-03:00...NaN102022-10-2312:18:59.267762600-03:00....pt112022-10-2306:00:01.068658100-03:00....pt122022-10-2307:23:56.117463800-03:00....pt132022-10-2308:53:33.799414100-03:00....pt142022-10-2312:18:59.048534200-03:00....pt[15rowsx14columns]df2Out[4]:aa_date...ff_flatcopy02022-10-2312:18:58.767317900-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...12022-10-2305:48:51.755017400-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...22022-10-2305:51:47.520702700-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...32022-10-2305:51:46.817189600-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...42022-10-2305:48:51.755017400-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...52022-10-2312:18:58.767317900-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...62022-10-2305:51:49.630625800-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...72022-10-2305:51:52.116036400-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...82022-10-2305:51:52.678404900-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...92022-10-2313:31:03.003835900-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...102022-10-2312:18:59.267762600-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...112022-10-2306:00:01.068658100-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...122022-10-2307:23:56.117463800-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...132022-10-2308:53:33.799414100-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...142022-10-2312:18:59.048534200-03:00...dest_folder:str,foldersep:str='ǀ',symlink:bo...[15rowsx21columns]