Pkg Utils¶
- walk_files(top, max_depth=-1, exclude_dirs=None, include_ext=None)[source]¶
Walk through the files recursively.
- Parameters:
top (str | Path) – Path to start from
max_depth (int) – Max recursion depth. If -1, there is no limit for recursion
exclude_dirs (set[str] | None) – Dirs to exclude. No dirs are excluded by default, but it is recommended to exlude dirs such as __pycache__, .tox etc
include_ext (set[str] | None) – Extensions to include. If None or empty, all extensions are included
- Returns:
Generator that produces files satisfying all given values
- Return type:
Iterator[Path]