--- id: igittigitt version: "2.2.3" license: MIT license_treatment: permissive maintenance: active --- # igittigitt — A spec-compliant .gitignore parser and path filter, 100% git-compatible, with an include/whitelist mode and a streaming, memory-bounded CLI License: permissive · Maintenance: active · Downloads: 134.0K/mo ## What it is and what it does igittigitt is a Python library and command-line tool that parses .gitignore files and determines whether paths match the ignore rules. It reproduces git's matching algorithm exactly, including negations, per-directory precedence, anchors, and glob patterns (**, *, ?, character classes). The library ships with type hints and no runtime dependency on the git binary itself. You can use it three ways: as a library to query whether a path is ignored, as a filter callback for shutil.copytree to copy directory trees while respecting .gitignore rules, or as a CLI tool that mirrors git check-ignore or acts as a Unix filter (reading paths from stdin and printing survivors). It also offers an IncludeParser mode that inverts the logic to whitelist files instead. Memory usage scales with the number of rules, not the number of files, making it suitable for large directory trees. Use it for: - Copy a project directory while excluding all ignored files (e.g., build artifacts, node_modules) using shutil.copytree. - Check whether specific paths would be ignored by git without invoking the git binary. - Filter a stream of file paths (from find or similar) to keep only non-ignored files in a pipeline. - Build a whitelist of files to include in a distribution or archive, excluding everything else. - Implement .gitignore-aware file operations in Python tools without shelling out to git. - Validate or test .gitignore rules programmatically against a set of paths. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A spec-compliant .gitignore parser that matches git's algorithm exactly, available as both a library and CLI tool for checking whether paths are ignored or filtering file trees. Yes. Active, well-maintained library with no known vulnerabilities, low install friction, and permissive licensing. Solves a real problem (git-compatible ignore matching in pure Python) with a proven algorithm. Suitable for both library and CLI use. Install if you need to respect .gitignore rules in Python code or need a standalone CLI tool for filtering paths. ## Install pip install igittigitt uv add igittigitt poetry add igittigitt ## Installing igittigitt Before you install: Low friction: pure Python wheel with no compiled dependencies. Active maintenance—last release 15 days ago, last commit 2026-08-01. Targets Python 3.10+ and tested across CPython 3.10–3.14. License in practice: MIT license (permissive). No restrictions on commercial or private use; attribution required but no copyleft obligations. Quickstart: import igittigitt parser = igittigitt.IgnoreParser() parser.parse_rule_files(base_dir="/path/to/project") parser.match("/path/to/project/file.pyc") # True if ignored # or as a copytree filter: import shutil shutil.copytree("src", "dst", ignore=parser.shutil_ignore) Requires Python 3.10 or later. Verify before relying: - Performance characteristics on very large .gitignore files or deeply nested directory structures beyond the stated O(depth x rules) analysis. - Whether the differential test suite against git check-ignore covers all edge cases in real-world projects. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 134.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags gitignore parser python, git-compatible ignore matching, filter files by gitignore rules, copytree with gitignore, whitelist include mode filter, streaming path filter cli, negation and precedence rules, gitignore, file-filtering, cli-tool [View on SkillFed](https://skillfed.io/packages/igittigitt) · [View on PyPI](https://pypi.org/project/igittigitt/)