Pydoc

pathfinder package.

pathfinder.find_paths(directory_path, just_dirs=None, just_files=None, regex=None, fnmatch=None, filter=None, ignore=None, abspath=None, depth=None)

Find paths in the tree rooted at filepath.

pathfinder.walk_and_filter(filepath, pathfilter, ignore=None, abspath=None, depth=None)

Walk the file tree and filter it’s contents.

pathfinder.walk_and_filter_generator(filepath, pathfilter, ignore=None, abspath=None, depth=None)

Walk the file tree and filter it’s contents.

To ignore any paths an specify an ignore filter.

To return absolute paths pass True for the abspath parameter.

To limit how deep into the tree you travel, specify the depth parameter.

pathfinder - making it easy to find paths.

class pathfinder.filters.AlwaysAcceptFilter

Accept every path.

accepts(_)

Always returns True.

class pathfinder.filters.AndFilter(*args)

Accept paths if all of it’s filters accept the path.

accepts(filepath)

Returns True if all of the filters in this filter return True.

class pathfinder.filters.ColorImageFilter
class pathfinder.filters.DirectoryFilter

Accept directory paths.

accepts(filepath)

Returns True if filepath represents a directory.

class pathfinder.filters.DotDirectoryFilter

Do not accept a path for a directory that begins with a period.

class pathfinder.filters.FileFilter

Accept file paths.

accepts(filepath)

Returns True if filepath represents a file.

class pathfinder.filters.FnmatchFilter(pattern)

Accept paths if they match the specifed fnmatch pattern.

accepts(filepath)

Returns True if the fnmatch pattern matches the filepath.

class pathfinder.filters.GreyscaleImageFilter
class pathfinder.filters.ImageDimensionFilter(max_width=None, max_height=None, min_width=None, min_height=None)

Accept paths for Image files.

class pathfinder.filters.ImageFilter

Accept paths for Image files.

class pathfinder.filters.NotFilter(pathfilter)

Negate the accept of the specified filter.

accepts(filepath)

Returns True of the sub-filter returns False.

class pathfinder.filters.OrFilter(*args)

Accept paths if any of it’s filters accept the path.

accepts(filepath)

Returns True if any of the filters in this filter return True.

class pathfinder.filters.RegexFilter(regex)

Accept paths if they match the specified regular expression.

accepts(filepath)

Returns True if the regular expression matches the filepath.

class pathfinder.filters.SizeFilter(max_bytes=None, min_bytes=None)
accepts(filepath)

Returns True if filepath represents a file.

pathfinder.filters.is_color_palette(palette)

Return whether the palette has color.

pathfinder.filters.is_greyscale_palette(palette)

Return whether the palette is greyscale only.

pathfinder.filters.stdv(band_means)

Calculate the standard deviation of the image bands.