gitignorefile
A spec-compliant `.gitignore` parser for Python
Decision gist · record as of 2026-08-14
Yes, if you need lightweight gitignore parsing with no external dependencies and your use case does not require ongoing maintenance or support for new Git features. The library is stable and works on modern Python versions, but its abandoned status means no fixes or updates will be released. Suitable for stable, self-contained projects; avoid if you need active maintenance or expect gitignore spec changes to affect your workflow.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- High install friction with no runtime dependencies.
- Package is marked abandoned (last commit 2023-05-29, 1440 days since release), though it carries a Production/Stable classifier and remains available for Python 3.6–3.12.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.
last release 2022-09-04 (1440 days) · last repo commit 2023-05-29 · 11 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 105,375 downloads/mo, #12,703 on PyPI
Alternatives
Verify before relying
import gitignorefile
matches = gitignorefile.parse("/path/to/.gitignore")
matches("/path/to/file.pyc") # Returns True or False
# Or check files against directory tree:
if gitignorefile.ignored("/path/to/file.py"):
print("File is ignored")- Whether the package correctly handles all edge cases in the gitignore spec (e.g., negation patterns, directory-only rules, trailing slashes)
- Performance characteristics when caching large directory trees with many .gitignore files
- Compatibility with recent Git versions' gitignore behavior changes since the last release in 2022
What it is and what it does
gitignorefile is a Python library that reads and interprets `.gitignore` files according to Git's specification. It provides functions to check whether individual file paths match ignore rules, either by parsing a single `.gitignore` file or by walking a directory tree to discover and apply all `.gitignore` and `.git/info/exclude` files in the hierarchy. The library also integrates with `shutil.copytree()` as an ignore callback and offers a caching layer to avoid re-parsing rules for repeated checks.
The package has no external runtime dependencies and supports Python 3.6 through 3.12. However, it is marked as abandoned—the last commit was in May 2023 and no releases have occurred since September 2022, so it will not receive updates for new Git features or bug fixes.
Use it for
- Filter files during directory copy operations to respect .gitignore rules without invoking git itself
- Build tools or scripts that need to skip ignored files when scanning a project directory
- Implement custom file-processing pipelines that must honor gitignore semantics
- Test whether a file path would be ignored by Git without running git commands
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need lightweight gitignore parsing with no external dependencies and your use case does not require ongoing maintenance or support for new Git features.
The library is stable and works on modern Python versions, but its abandoned status means no fixes or updates will be released. Suitable for stable, self-contained projects; avoid if you need active maintenance or expect gitignore spec changes to affect your workflow.
Install
gitignorefile on PyPI
Before you install
High install friction with no runtime dependencies. Package is marked abandoned (last commit 2023-05-29, 1440 days since release), though it carries a Production/Stable classifier and remains available for Python 3.6–3.12.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.
Quickstart
import gitignorefile
matches = gitignorefile.parse("/path/to/.gitignore")
matches("/path/to/file.pyc") # Returns True or False
# Or check files against directory tree:
if gitignorefile.ignored("/path/to/file.py"):
print("File is ignored")
Verify before relying
- Whether the package correctly handles all edge cases in the gitignore spec (e.g., negation patterns, directory-only rules, trailing slashes)
- Performance characteristics when caching large directory trees with many .gitignore files
- Compatibility with recent Git versions' gitignore behavior changes since the last release in 2022
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,440 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,375 / month, #12,703 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Version Control :: GitTopic :: Text Processing :: Filters |
Evidence: gitignorefile-1.1.2.tar.gz
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 › “ignore file handling”
- gitignorefileParses `.gitignore` files according to Git's specification and checks…
- rignoreProvides fast directory traversal with support for .gitignore rules…
- ignore-pythonProvides fast recursive directory traversal with automatic filtering…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also gitignorant · gitignore-parser · igittigitt · ignore · pathspec · py-walk · rignore · diff-parser · ripgrep · trailrunner