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.AndFilter(*args)
Accept paths if all of it’s filters accept the path.
- accepts(filepath)
Return True if all of the filters in this filter return True.
- class pathfinder.filters.ColorImageFilter
Accept colour images.
- accepts(filepath)
Return True if the file at filepath is a colour image.
- class pathfinder.filters.DirectoryFilter
Accept directory paths.
- accepts(filepath)
Return 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)
Return True if filepath represents a file.
- class pathfinder.filters.Filter
Base filter class.
- find(filepath)
Walk the directory and try to find the filepath.
- class pathfinder.filters.FnmatchFilter(pattern)
Accept paths if they match the specifed fnmatch pattern.
- accepts(filepath)
Return True if the fnmatch pattern matches the filepath.
- class pathfinder.filters.GreyscaleImageFilter
Accept black and white images.
- accepts(filepath)
Return true if the file located at filepath is a greyscale image.
- class pathfinder.filters.ImageDimensionFilter(max_width=None, max_height=None, min_width=None, min_height=None)
Accept paths for Image files.
- accepts(filepath)
Return True if filepath satisfies the image constraints.
- class pathfinder.filters.ImageFilter
Accept paths for Image files.
- accepts(filepath)
Return true if filepath has an image extension.
- class pathfinder.filters.NotFilter(pathfilter)
Negate the accept of the specified filter.
- accepts(filepath)
Return 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)
Return 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)
Return True if the regular expression matches the filepath.
- class pathfinder.filters.SizeFilter(max_bytes=None, min_bytes=None)
Accept files within a min and/or max bytes range.
- accepts(filepath)
Return True if the file size is within the range.
- 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.