Glob¶
Bases: BaseFileFilter, FrozenModel
Filter files or directories with path matching a glob expression.
Added in 0.8.0
Replaces deprecated onetl.core.FileFilter
Parameters:
-
pattern(str) –Pattern (e.g.
*.csv) for which any file (only file) path should match
Examples:
Create glob filter:
from onetl.file.filter import Glob
glob = Glob("*.csv")
match(path)
¶
Returns True if path is matching the filter, False otherwise
Added in 0.8.0
Examples:
>>> from onetl.impl import LocalPath
>>> filter.match(LocalPath("/path/to/file.csv"))
True
>>> filter.match(LocalPath("/path/to/excluded.csv"))
False
>>> filter.match(LocalPath("/path/to/file.csv"))
True