Findtools is a pythonic implementation of file search routines inspired by GNU Findutils.
Documentation: https://ewiger.github.io/findtools/
from findtools.find_files import find_files, Match
# Recursively find all *.sh files in /usr/bin
sh_files_pattern = Match(filetype='f', name='*.sh')
found_files = find_files(path='/usr/bin', match=sh_files_pattern)
for found_file in found_files:
print(found_file)The above is equivalent to
find /usr/bin -type f -name '*.sh'pip install findtoolsor with uv:
uv add findtoolsRequires Python 3.9+. Findtools has no dependencies outside the standard library.
The project is managed with uv:
git clone https://github.com/ewiger/findtools.git && cd findtools
uv sync --group devRun the test suite with pytest:
uv run pytestor via make:
make testThe docs are built with Material for MkDocs
and deployed to GitHub Pages on every push to master. To preview locally:
make docs-servePlease report issues at https://github.com/ewiger/findtools/issues.