globsters 0.0.3

Creator: bradpython12

Last updated:

Add to Cart

Description:

globsters 0.0.3

globsters
python & rust globsters
glob + lobster + rs (rs) = globsters
from globsters import globster

# single
matcher_1 = globster("**/*.py")

assert matcher_1("foo/bar/baz.py") # True
assert not matcher_1("foo/bar/baz.pyc") # False

# single case insensitive
matcher_2 = globster("**/*.py", case_insensitive=True)
assert matcher_2("foo/bar/baz.PY") # True

# multi (also works with negation)
matcher_3 = globster(["*.py", "*.txt"])
assert matcher_3("foo/bar/baz.py") # True
assert matcher_3("foo/bar/baz.txt") # True
assert not matcher_3("foo/bar/baz.pyc") # False

# multi negation (also works with case insensitive)
matcher_4 = globster(["*.py", "!__init__.py"])
assert matcher_4("foo/bar/baz.py") # True
assert not matcher_4("foo/bar/__init__.py") # False

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.