I am writing a API for a program. The program has a native support of "globed" paths such as img-0*.png. I would like to know how to be sure that there is at least a file satisfying that pattern, a kind of is_globable(path) method. path = 'img-0*.png' if os.path.isfile(path): pass elif is_globable(path): pass else: raise Exception(...) Neither glob or pathlib provide such a functionality. The most related method I found is pathlib.PurePath.full_match but solves the opposite problem. Continue reading...