aklab.dirutil module#
Tools to work with files and folders, uses os
, shutil
.
- aklab.dirutil.add_sufix(pth, suffix='')[source]#
Add suffix to filepath
- Parameters
pth (str) – file path
suffix (str) – suffix to append before file extension
- Returns
path with appended suffix
- Return type
str
- aklab.dirutil.copy(src, targ, keys, suffix='', copy=False)[source]#
Copy files
- Parameters
scrs (string) – source directory
targ (string) – target directory
keys (list) – list of keys. If all keys are in filename in
os.listdir(src)()
, adds to listcopy (bool) – default False, if True - will copy
- Returns
if no exception, will return list of matching filenames
- Return type
list or None