Wcmatch
Bash-style wildcard file matching, globbing, and pathlib for Python
Repository Health
Technical Analysis
Wcmatch is a Python library that reimplements and extends the stdlib fnmatch, glob, and pathlib modules with the richer wildcard semantics found in Bash — brace expansion, extended glob pattern groups, escaping, ** recursive globbing, and POSIX character classes. It also adds a path-centric globmatch function and a standalone file-search utility.
Originally split out of the Rummage file-search tool by maintainer Isaac Muse (facelessuser), Wcmatch is now a standalone dependency used by other projects needing more expressive file/path pattern matching than Python’s builtins provide.
What You Get
- Enhanced
fnmatch,glob, andpathlibmodules with a superset of stdlib functionality globmatchfor matching path strings against glob patterns without filesystem access- Bash-style features: brace expansion, extended glob groups (
@(...),+(...), etc.), and\escaping - POSIX character class support (
[[:alnum:]]) using the C locale - A standalone
wcmatchfile-crawler utility built on top of the core matching engine
Common Use Cases
- Implementing
.gitignore-style or Bash-glob-compatible file filtering in Python tools - Validating whether arbitrary path strings match user-supplied glob patterns
- Replacing Python’s builtin glob/fnmatch where brace expansion or extended patterns are needed
- Building CLI tools or linters that need configurable, Bash-familiar file selection patterns
Under The Hood
Architecture - The library centers on a shared parsing/matching engine (_wcparse.py, _wcmatch.py) that compiles glob/fnmatch patterns into regular expressions, with thin public-facing modules (fnmatch.py, glob.py, pathlib.py, posix.py) exposing stdlib-compatible entry points layered on top of that shared core. Tech Stack - Pure Python with no runtime dependencies beyond the standard library, using py.typed for inline type hint distribution and standard setuptools packaging. Code Quality - The tests/ directory has dedicated test modules per public interface (test_fnmatch.py, test_glob.py, test_globmatch.py, test_pathlib.py, test_wcparse.py) plus Codecov-tracked coverage, indicating disciplined per-surface testing. API Design - By deliberately mirroring the signatures of fnmatch/glob/pathlib, the library keeps the learning curve low for anyone familiar with Python’s stdlib, while documenting its Bash-derived extensions clearly on a dedicated docs site.
Used by 3 apps in this directory
Airbyte
Developer Tools · Data Engineering
Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.
CubeSandbox
Developer Tools · Security · AI Agents
Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.
deepagents
AI Agents · AI Development
The batteries-included Python agent harness — planning, sub-agents, filesystem, shell, memory, and skills bundled in, built on LangGraph.