glob2
Version of the glob module that can capture patterns and supports recursive wildcards
What it is and what it does
glob2 is an extended version of Python's standard glob module that adds three main capabilities: the ability to capture matched text from glob patterns and return them alongside filenames, recursive ** wildcard syntax for matching across directory trees, and support for custom virtual filesystem implementations. It was based on Python 3.3.1's glob code and is compatible with both Python 2 and 3.
The package has no runtime dependencies and is designed as a drop-in enhancement to the standard library. However, it is distributed as source code only and has been abandoned since 2021, with the last release in 2019. While the repository remains public, there has been no maintenance activity for several years, which may affect compatibility with modern Python versions.
Use it for:
- Find all files matching a pattern recursively across nested directories using ** syntax.
- Extract version numbers or other captured groups from filenames while globbing.
- Implement custom globbing logic over virtual or remote filesystems by subclassing Globber.
- Migrate code from bash globstar patterns to Python with compatible ** recursive syntax.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
glob2 extends Python's built-in glob module with recursive ** wildcard syntax, pattern capture groups, and support for custom virtual filesystems.
No. The package is abandoned with no maintenance since 2021 and last tested on Python 3.3. Modern Python versions (3.10+) have incorporated recursive glob support natively via pathlib and the standard glob module. High install friction and lack of active maintenance make this a poor choice for new projects; use the standard library instead.
Install
glob2 on PyPI
pip
pip install glob2uv
uv add glob2poetry
poetry add glob2Installing glob2
Before you install
High install friction due to source-only distribution. Package is abandoned as of 2021 with no maintenance activity for several years, though the repository remains public and the last commit is from 2021-08-01.
License in practice
BSD license is permissive; you may use, modify, and distribute this package with minimal restrictions.
Quickstart
import glob2
# Recursive glob
header_files = glob2.glob('src/**/*.h')
# Glob with pattern capture
for filename, (version,) in glob2.iglob('./binaries/project-*.zip', with_matches=True):
print(version)
Package is source-only (tar.gz); requires a build environment and may need compilation depending on your Python setup.
Verify before relying
- Whether the package works reliably with modern Python versions beyond 3.3 (last tested version mentioned in description).
- Whether the abandoned status and lack of maintenance since 2021 poses compatibility risks with current Python releases.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,622 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,106,650/month — #4,364 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: glob2-0.7.tar.gz
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
wcmatchwcmatch provides enhanced file pattern matching…
permissive · top 1,000 on PyPI
globmatchMatches file paths against glob patterns…
permissive · top 15,000 on PyPI
scantreeRecursively scans directories with flexible…
permissive · top 5,000 on PyPI
formic2Formic implements Apache Ant FileSet and glob…
copyleft · top 5,000 on PyPI
gitmatchGitmatch implements gitignore-style pattern…
permissive · top 15,000 on PyPI
pathtoolsProvides pattern matching and utility functions…
permissive · top 15,000 on PyPI
dpathdpath lets you access, search, and modify…
permissive · top 5,000 on PyPI
ignore-pythonProvides fast recursive directory traversal…
unclear · top 15,000 on PyPI
mkdocs-excludeA mkdocs plugin that excludes files and…
permissive · top 15,000 on PyPI
path.pyProvides Path objects that wrap filesystem…
permissive · top 15,000 on PyPI