Welcome to ‘pathwalker’ documentation!¶
pathwalker is a micro module containing 2 helper methods for walking either
directories (pathwalker.walk_folder_paths()
) or file paths
(pathwalker.walk_file_paths()
) providing an additional filtering
by an unix filepath pattern.
Basic Usage¶
Walk through folders only.
>>> from pathwalker import walk_folder_paths
>>> for found_folder in walk_folder_paths(".", filter_pattern = "[!._]*"):
... print(found_folder)
docs
tests
Walk through files only.
>>> from doctestprinter import doctest_iter_print
>>> from pathwalker import walk_file_paths
>>> found_files = sorted(
... walk_file_paths(".", filter_pattern = "[!._]*.py", recursive=True),
... key=lambda x: str(x)
... )
>>> doctest_iter_print(found_files)
docs/conf.py
pathwalker.py
setup.py
tests/path_test.py