globsters
python & rust globsters
glob + lobster + rs (rs) = globsters
from globsters import globster
matcher_1 = globster("**/*.py")
assert matcher_1("foo/bar/baz.py")
assert not matcher_1("foo/bar/baz.pyc")
matcher_2 = globster("**/*.py", case_insensitive=True)
assert matcher_2("foo/bar/baz.PY")
matcher_3 = globster(["*.py", "*.txt"])
assert matcher_3("foo/bar/baz.py")
assert matcher_3("foo/bar/baz.txt")
assert not matcher_3("foo/bar/baz.pyc")
matcher_4 = globster(["*.py", "!__init__.py"])
assert matcher_4("foo/bar/baz.py")
assert not matcher_4("foo/bar/__init__.py")