Shortcuts

caer.path

caer.path.abspath(file_name)[source]

Returns the absolute path of file_name

Return type

str

caer.path.chdir(path)[source]

Checks into directory path

Return type

None

caer.path.cwd()[source]

Returns the filepath to the current working directory

Return type

str

caer.path.dirname(file)[source]

Returns the base directory name of file

Return type

str

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

Parameters
  • file (str) – Filepath to check

  • disp_format (str) – Size format (bytes/kb/mb/gb/tb)

Returns

File size in bytes/kb/mb/gb/tb

Return type

size (str)

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.join(*paths)[source]

Join multiple filepaths together

Return type

str

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
  • DIR (str) – Directory to search for image 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)

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)

caer.path.mkdir(path)[source]

Creates a directory at path

Return type

None

Read the Docs v: latest
Versions
latest
stable
Downloads
pdf
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.