flowbber.utils.filter
¶Utilities for filtering data.
included_in()
:
Check if the given value is included in the given list of patterns.is_wanted()
:
Check that the given value is included in the include list and not includedfilter_dict()
:
Filter a dictionary using the provided include and exclude patterns.load_filter_file()
:
Load a “.gitignore”-like file describing excluding (or including) fnmatchflowbber.utils.filter.
included_in
(value, patterns)¶Check if the given value is included in the given list of patterns.
flowbber.utils.filter.
is_wanted
(value, include, exclude)¶Check that the given value is included in the include list and not included in the exclude list.
flowbber.utils.filter.
filter_dict
(data, include, exclude, joinchar='.')¶Filter a dictionary using the provided include and exclude patterns.
The filtered dictionary.
dict or OrderedDict
flowbber.utils.filter.
load_filter_file
(filepath, encoding='utf-8')¶Load a “.gitignore”-like file describing excluding (or including) fnmatch patterns.
Empty lines and comments (#) are supported. Patterns returned are unique and in the same order as described in the file.