Traverse the file tree.
pip install walkmate
Given a multi-level directory structure:
.
├── one.py
├── two.py
└── child
└── three.py
We can list all the files tree:
>>> tree("test/fixtures")
["one.py", "two.py", "child/three.py"]
Filter with a regex:
>>> tree("test/fixtures", r"one\.py$")
["one.py"]
Add exlude patterns too:
>>> tree("test/fixtures", r"\.py$", [r"one\.py$"])
["two.py", "child/three.py"]
Specify the maximum depth:
>>> tree("test/fixtures", depth=1)
["one.py", "two.py"]