gitignorant
A parser for gitignore files
Decision gist · record as of 2026-08-14
Yes, if you need to match files against .gitignore rules in Python code. The library is lightweight, has no dependencies, and carries a permissive license. Maintenance is dormant but the code is stable and unarchived; use it for straightforward single-file gitignore matching, but be aware that hierarchical .gitignore support requires custom integration.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with no runtime dependencies.
- Maintenance is dormant—last commit was 2025-01-03 and no release since 2024-11-01, but the repository remains active and unarchived.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) allows free use, modification, and distribution with minimal restrictions.
last release 2024-11-01 (651 days) · last repo commit 2025-01-03 · 6 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 143,734 downloads/mo, #11,167 on PyPI
Alternatives
Verify before relying
from gitignorant import parse_gitignore_file
rules = parse_gitignore_file('.gitignore')
matches = rules.match('path/to/file.txt')- Whether the implementation fully conforms to the gitignore spec or has known limitations beyond the stated lack of direct tree support
- Performance characteristics on large .gitignore files or when matching many paths
What it is and what it does
Gitignorant is a Python library that reads and parses .gitignore files, then matches file paths against the rules using the same semantics Git uses (last matching rule wins). It requires Python 3.7 or newer, includes full type hints, and has no runtime dependencies. The library handles single .gitignore files directly; hierarchical .gitignore trees (where different directories have their own .gitignore files) are not built in but can be implemented by calling code.
You would use this when you need to programmatically determine whether a file should be ignored according to .gitignore rules—for example, in build tools, linters, or file synchronization utilities that need to respect the same ignore patterns as Git itself.
Use it for
- Build tools or deployment scripts that need to exclude files matching .gitignore patterns
- Linters or code analysis tools that should skip ignored files
- File synchronization or backup utilities that respect .gitignore semantics
- Testing frameworks that filter test files based on .gitignore rules
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to match files against .gitignore rules in Python code.
The library is lightweight, has no dependencies, and carries a permissive license. Maintenance is dormant but the code is stable and unarchived; use it for straightforward single-file gitignore matching, but be aware that hierarchical .gitignore support requires custom integration.
Install
gitignorant on PyPI
Before you install
Low friction install with no runtime dependencies. Maintenance is dormant—last commit was 2025-01-03 and no release since 2024-11-01, but the repository remains active and unarchived.
License in practice
MIT license (permissive) allows free use, modification, and distribution with minimal restrictions.
Quickstart
from gitignorant import parse_gitignore_file
rules = parse_gitignore_file('.gitignore')
matches = rules.match('path/to/file.txt')
Verify before relying
- Whether the implementation fully conforms to the gitignore spec or has known limitations beyond the stated lack of direct tree support
- Performance characteristics on large .gitignore files or when matching many paths
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 651 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 143,734 / month, #11,167 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: gitignorant-0.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “gitignore parser”
- gitignorantParses .gitignore files and matches file paths against the parsed…
- gitignore-parserParses .gitignore files and returns a callable matcher that tests…
- pathspecMatches file paths against gitignore-style patterns, supporting both…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also gitignore-parser · gitignorefile · pathspec · igittigitt · gitmatch · rignore · py-walk · Protego · yara-python · trailrunner