Metadata-Version: 2.4
Name: minimindslab-path-glob-filter
Version: 0.1.0
Summary: Pure-Python helpers to filter relative file paths by simple include/exclude glob rules with deterministic matching order.
Author: MiniMindsLab
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# MiniMindsLab Path Glob Filter

Pure-Python helpers to filter relative file paths by simple include/exclude glob rules with deterministic matching order.

## Features

- Standard library only
- No filesystem access required
- Deterministic output ordering (input order preserved)
- Simple include/exclude glob rule handling
- Consistent path separator normalization (`\\` -> `/`)

## Quick usage

```python
from minimindslab_path_glob_filter import filter_paths

paths = [
    "src/main.py",
    "src/util/helpers.py",
    "tests/test_main.py",
    "README.md",
]

result = filter_paths(
    paths,
    include_patterns=["src/*.py", "src/**/*.py", "README.md"],
    exclude_patterns=["src/util/*"],
)

print(result.matched)   # ['src/main.py', 'README.md']
print(result.excluded)  # ['src/util/helpers.py']
```

## Matching semantics

- Patterns use `fnmatch`-style glob syntax (`*`, `?`, `[seq]`).
- Paths are treated as relative path strings.
- Backslashes are normalized to forward slashes for both paths and patterns.
- Include phase:
  - If `include_patterns` is empty, all input paths are initially included.
  - Otherwise, a path is initially included if it matches at least one include pattern.
- Exclude phase:
  - Any initially included path that matches an exclude pattern is moved to `excluded`.
  - Exclusion takes precedence over inclusion.
- Output order follows original input order.

## Testing

Run tests with:

```bash
python -m unittest discover -s tests -p "test*.py"
```
