fpf.filters

Extensible File Path Filters.

Classes

class fpf.filters.ExtensionFileFilter(extensions={}, ignore_case=True)[source]

Filter files based on a match of the file extensions.

You can set it to ignore cases. Make sure to start each extension with the dot (.).

Create a new filter based on file extensions.

Parameters
  • extensions (Set[str], optional) – File extensions to whitelist, defaults to an empty set. The extension should start with ..

  • ignore_case (bool, optional) – Ignore extension case (.exe vs .EXE), defaults to True

Inheritance

Inheritance diagram of ExtensionFileFilter
class fpf.filters.IgnoreFileFilter(ignore_file_path)[source]

Filter files based on an ignore file like .gitignore.

Create a filter based on an ignore file.

Parameters

ignore_file_path (str) – path to the ignore file.

Inheritance

Inheritance diagram of IgnoreFileFilter
class fpf.filters.PathSpecWildcardFileFilter(path_spec_str='')[source]

Filter files based on PathSpec WildMatch (.gitignore).

Create a new path spec wildcard file filter.

Parameters

path_spec_str (str, optional) – pathspec wildcard paterns. One per line, defaults to ‘’. If you want to ignore all hidden files, a valid pattern would be .*

Inheritance

Inheritance diagram of PathSpecWildcardFileFilter
class fpf.filters.YamlIgnoreFileFilter(ignore_file_path='.yamlignore', extensions=['.yml', '.yaml'], ignore_extension_case=True)[source]

Filter YAML files(.yml, .yaml) based on pathspec wildcard file(gitignore style).

Create a filepath filter based on a .yamlignore file (similar to a .gitignore).

Parameters
  • ignore_file_path (str, optional) – path to the yamlignore file, defaults to .yamlignore

  • extensions (list, optional) – Extensions to allow, defaults to ['.yml', '.yaml'].

  • ignore_extension_case (bool, optional) – ignore cases of extensions(yml vs YML), defaults to True.

Inheritance

Inheritance diagram of YamlIgnoreFileFilter
class fpf.filters.YamlPathSpecFilter(path_spec_str='', extensions=['.yml', '.yaml'], ignore_extension_case=True)[source]

Filter YAML files (.yml, .yaml) based on pathspec wildcards (gitignore style).

Create a PathSpec Wildcard filter.

Parameters
  • path_spec_str (str, optional) – pathsspec multiline string, defaults to '' (no spec)

  • extensions (list, optional) – YAML file extensions, defaults to ['.yml', '.yaml'].

  • ignore_extension_case (bool, optional) – ignore extension cases, defaults to True

Inheritance

Inheritance diagram of YamlPathSpecFilter
class fpf.filters.UnixHiddenFileFilter[source]

Filter out any hidden files (starting with a .).

Inheritance

Inheritance diagram of UnixHiddenFileFilter
class fpf.filters.DummyFilter[source]

Do not filter out anything.

Inheritance

Inheritance diagram of DummyFilter