caer.path¶
- caer.path.exists(path)[source]¶
Checks if a given filepath is valid
- Parameters
path¶ (str) – Filepath to check
- Return type
bool
- Returns
True; if path is a valid filepath False; otherwise
- caer.path.get_size(file, disp_format='bytes')[source]¶
Returns: the size of file in bytes/kb/mb/gb/tb
- caer.path.is_image(path)[source]¶
Checks if a given path is that of a valid image file
- Parameters
path¶ (str) – Filepath to check
- Return type
bool
- Returns
True; if path is a valid image filepath False; otherwise
- caer.path.is_video(path)[source]¶
Checks if a given path is that of a valid image file
- Parameters
path¶ (str) – Filepath to check
- Return type
bool
- Returns
True; if path is a valid image filepath False; otherwise
- caer.path.isfile(path)[source]¶
Checks if a given filepath is a valid path
- Parameters
path¶ (str) – Filepath to check
- Return type
bool
- Returns
True; if path is a valid filepath False; otherwise
- caer.path.list_images(DIR, recursive=True, use_fullpath=False, verbose=True, every=1000)[source]¶
Lists all image files within a specific directory (and sub-directories if recursive=True)
- Parameters
- Returns
List of names (or full filepaths if use_fullpath=True) of the image files
- Return type
image_files (list)
- caer.path.list_videos(DIR, recursive=True, use_fullpath=False, verbose=True, every=1000)[source]¶
Lists all video files within a specific directory (and sub-directories if recursive=True)
- Parameters
DIR¶ (str) – Directory to search for video files
recursive¶ (bool) – Indicate whether to search all subdirectories as well (default = False)
use_fullpath¶ (bool) – Include full filepaths in the returned list (default = False)
show_size¶ (bool) – Prints the disk size of the video files (default = False)
- Returns
List of names (or full filepaths if use_fullpath=True) of the video files
- Return type
video_files (list)
- caer.path.listdir(DIR, recursive=False, use_fullpath=False, ext=None, verbose=True, every=1000)[source]¶
Lists all files within a specific directory (and sub-directories if recursive=True). This can be filtered for certain extensions (by populating ext)
- Parameters
DIR¶ (str) – Directory to search for files
recursive¶ (bool) – Indicate whether to search all subdirectories as well (default = False)
use_fullpath¶ (bool) – Include full filepaths in the returned list (default = False)
ext¶ (str, list(str), tuple(str)) – Filter by extension names.
show_size¶ (bool) – Prints the disk size of the files (default = False)
verbose¶ (bool) – Print info
every¶ (int) – If
verbose = True
, logging info is displayed after every every times.
- Returns
List of names (or full filepaths if use_fullpath=True) of the files
- Return type
files (list)