A Python library for file-related tasks.
This library is designed to be used as a git submodule:
git submodule add https://github.com/rendicahya/python_file.git
pip install tqdm
This project depends on another project that must also be installed as a submodule in the main project:
git submodule add https://github.com/rendicahya/assertpy.git
Returns the number of files in a directory. Parameters:
recursive
(boolean, default:True
)ext
(string, default:None
)
Usage:
from python_file import count_files
path = "/some/path"
n_files = count_files(path, recursive=True, ext=".txt")