fpf.filters¶
Extensible File Path Filters.
Classes¶
ExtensionFileFilter: Filter files based on a match of the file extensions.IgnoreFileFilter: Filter files based on an ignore file like .gitignore.PathSpecWildcardFileFilter: Filter files based on PathSpec WildMatch (.gitignore).YamlIgnoreFileFilter: Filter YAML files(.yml, .yaml) based on pathspec wildcard file(gitignore style).YamlPathSpecFilter: Filter YAML files (.yml, .yaml) based on pathspec wildcards (gitignore style).UnixHiddenFileFilter: Filter out any hidden files (starting with a .).DummyFilter: Do not filter out anything.
- 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 (
.exevs.EXE), defaults to True
Inheritance

- 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

- 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

- 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
.yamlignorefile (similar to a.gitignore).- Parameters
ignore_file_path (str, optional) – path to the yamlignore file, defaults to
.yamlignoreextensions (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

- 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


