--- id: gitignore-parser version: "0.1.13" license: MIT license_treatment: permissive maintenance: aging --- # gitignore-parser — A spec-compliant gitignore parser for Python 3.5+ License: permissive · Maintenance: aging · Downloads: 3.0M/mo ## What it is and what it does gitignore_parser is a Python library that reads .gitignore files and produces a callable matcher function. You pass it a gitignore file path or a string of gitignore rules, and it returns a function that you can call with file paths to determine whether they match the ignore patterns. The library claims to support the full gitignore spec, including features like square-bracket character classes (e.g., `*.py[cod]`) and top-level path anchors (e.g., `/...`), which the author notes are missing from some competing libraries. The package has no runtime dependencies and supports Python 3.5 through 3.12. It was first released in 2018 and has been maintained sporadically; the most recent release was 354 days ago. The repository remains active with recent commits, but the long release interval suggests the package may be in a stable-but-not-actively-developed state. Use it for: - Build tools and file processors that need to respect .gitignore rules when scanning project directories. - Testing frameworks that want to exclude ignored files from test discovery or coverage reports. - Version control utilities or scripts that programmatically check whether files should be tracked. - Project analysis tools that need to filter out ignored paths when walking a directory tree. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses .gitignore files and returns a callable matcher that tests whether file paths should be ignored according to gitignore rules. Yes, if you need to programmatically evaluate gitignore rules in Python. The package is stable, has no dependencies, supports a wide range of Python versions, and carries no known vulnerabilities. The long release interval and aging maintenance status are not blockers for a mature, single-purpose library, but you should verify that it handles your specific gitignore patterns correctly before relying on it in production. ## Install pip install gitignore-parser uv add gitignore-parser poetry add gitignore-parser ## Installing gitignore-parser Before you install: High install friction: the package has no runtime dependencies but has not been released in 354 days, and its status is marked as aging. The repository is not archived and has recent commits, but the long gap between releases may indicate limited active maintenance. License in practice: MIT license (permissive) means you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions. Quickstart: from gitignore_parser import parse_gitignore matches = parse_gitignore('/path/to/.gitignore') if matches('/path/to/file.pyc'): print('File is ignored') Verify before relying: - Whether the package handles all edge cases of the gitignore spec (the description mentions it aims to be spec-compliant but does not detail which spec version or known limitations). - Current test coverage and whether the aging maintenance status reflects active use or dormancy. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: aging - Downloads: 3.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags gitignore parser, parse gitignore rules, gitignore file matcher, check if file matches gitignore, gitignore pattern matching, spec-compliant gitignore, gitignore pattern tester, gitignore, file-matching, build-tools [View on SkillFed](https://skillfed.io/packages/gitignore-parser) · [View on PyPI](https://pypi.org/project/gitignore-parser/)