Skip to main content

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


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 details)

Uploaded Source

Built Distribution

mfind-0.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file mfind-0.0.2.tar.gz.

File metadata

  • Download URL: mfind-0.0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

File hashes

Hashes for mfind-0.0.2.tar.gz
Algorithm Hash digest
SHA256 004a878b8c057235e0dcd4f9169be87857605ffe86f3a9f672a87f0c75bc2b49
MD5 17fd16c9fabc404b314baee740e5c5b0
BLAKE2b-256 2342cb48878ac6447c772389e4c7f67a881131c1126e08ab4194c1e60383ce35

See more details on using hashes here.

File details

Details for the file mfind-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: mfind-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

File hashes

Hashes for mfind-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bf2042abf6e11a470b030afc1e6afdbb69f67218e1f2818232f67beb99364223
MD5 74fa3715ecea611aa732a9d497927dfc
BLAKE2b-256 cdc4cf29416fc62a42f9022febf009c02e88b1e092cb2095e3a21a8ab9d1f104

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page