Scan a directory for files an apply callbacks on name matches
Project description
mfind
The mfind library allows to scan a directory for file an apply callbacks on file matches
How to install
pip install mfind
How to use
from mfind import MultiFinder
def internal_handler(filename: str):
return False # Just about all other handler checks
def html_handler(filename: str):
print(f"Processing HTML file {filename}")
def mardkown_handler(filename: str):
print(f"Processing markdown file {filename}")
file_processing_map = {
"_*" : internal_handler,
"*.html" : html_handler,
"*.md" : mardkown_handler
}
mf = MultiFinder(file_processing_map)
mf.scan("test_dir", filename_only_match=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mfind-0.0.2.tar.gz
(5.8 kB
view hashes)
Built Distribution
mfind-0.0.2-py3-none-any.whl
(4.2 kB
view hashes)